Open jdbaculard-ap opened 11 months ago
Hi, unfortunately I don't speak French, if you translate this message to English I'd be more than happy to help
Hi thanks you
I want to send a message a few minutes later to the correct user. And it doesn't work.
the say method fails when i use getUser()->getId() saved in the DB in table "jobs"
Botman never display the message
Thanks
If you are using laravel and the request object is present (not background jobs/queues) you can get the active session of the user by calling auth() and then chain the ID method auth()->id() or if you want to make something more complex like sending a message when the task or job is completed that could be harder because botman doesn't use websockets or long polling by default, in that case I would suggest you to maybe save the user_id to be notified and implement it using the broadcasting feature
Thanks. It is not easy
Is the web widget compatible with laravel-echo?
Not out of the box, but you can wire them up! https://botman.io/2.0/web-widget
Go to the api Section and you can use the say method
Eg say something as the user, maybe a specific intent code to retrieve a specific message
Yes it is OK, thank you
window.Pusher = Pusher;
window.Echo = new Echo({
broadcaster: 'pusher',
key: import.meta.env.VITE_PUSHER_APP_KEY,
cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER,
forceTLS: true
});
window.Echo.channel('channel-' + window.userId)
.listen('.App\\Events\\ReplyEvent', (e) => {
window.botmanChatWidget.sayAsBot(e.message)
});
Bonjour Bravo pour le boulot.
Par contre depuis la queue, je souhaite renvoyer un message quelques minutes plus tard au bon user. Et ça ne fonctionne pas.
Est ce que cela devrait marcher depuis la queue ?
En gros la méthode say n'arrive pas à renvoyer le message au getUser()->getId()