opening an issue to discuss a feature proposal. I've already found a workaround, but I thought to start a discussion about this use case & a more kosher api for it.
I have a bot which I would like to start proactively - for a user (me) where the id is known ahead of time. this bot is a ChatBot and keeps state, messaging me every so often with a question which I respond to. so I want it to message me even if I haven't messaged it since the last restart.
after doing some digging my workaround is to just simulate sending it a message during application start:
is this use case valid enough that maybe ChatBot should support it in a non-hacky manner?
I'm not exactly sure what the api would look like if so. maybe some function like ChatBot.start(chatbot_behavior, chat_id) (ChatBot.start(MyBot, @chat_id_me) in the example above), which would call Chat.Session.Supervisor.start_child/2 ?
hello again :)
opening an issue to discuss a feature proposal. I've already found a workaround, but I thought to start a discussion about this use case & a more kosher api for it.
I have a bot which I would like to start proactively - for a user (me) where the id is known ahead of time. this bot is a
ChatBot
and keeps state, messaging me every so often with a question which I respond to. so I want it to message me even if I haven't messaged it since the last restart.after doing some digging my workaround is to just simulate sending it a message during application start:
is this use case valid enough that maybe
ChatBot
should support it in a non-hacky manner?I'm not exactly sure what the api would look like if so. maybe some function like
ChatBot.start(chatbot_behavior, chat_id)
(ChatBot.start(MyBot, @chat_id_me)
in the example above), which would callChat.Session.Supervisor.start_child/2
?hope this made sense!