-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation bot improvements #11
Comments
Can you elaborate on the boilerplate you get? I see how it can arise, but I'd like to know more about your specific case. I am not sure where do you expect |
@anpryl note that I am working on a new release with a lot of new nice features on |
In my case, I need to store a mapping (in database) between UserID in my system and telegram's ChatID. So in most handlers I need ChatId to lookup user data and it leads to boiler plate like mchatID <- currecntChatId
case mchatID of
Just chatID -> do something
Nothing -> pure NoOp I understand that update can be without ChatId. But is it possible in conversation mode? We need ChatId to lookup conversation from |
I think I see your point, but I'll have to think a little more about it. I think we can actually make newtype BotM context a = BotM { _runBotM :: ReaderT context ClientM a }
newtype Eff action model = Eff { _runEff :: Writer [BotM BotContext action] model } With this we might use something similar to |
currentChatId always returns
Maybe ChatId
but in conversationBot we always haveChatId
. It leads to meaningless boilerplate code every time ChatId is needed in handlers.What do you think about
ConversationM
?Here is example:
@fizruk
Is there are any hidden issues which will block this improvement?
If you are OK with this I will try to create prototype next week.
The text was updated successfully, but these errors were encountered: