Closed ghost closed 7 years ago
Would be cool if chat
already had this property included.
Oh wait, I think I basically had it:
bot.use((ctx, next) => {
const reply = ctx.reply;
ctx.reply = (...args) => {
ctx.session.lastMessage = args;
reply(...args);
};
return next();
});
Is this it?
Yes, you can save any user related info to session storage.
Also, check out telegraf-flow
library.
I feel like this should be trivial but I still can't quite get there:
Overriding reply also seems like a dead end:
Note I'm not talking about the user message but the last message sent from the server. It's useful so that I can keep track of ''where'' the user is at any time.