Closed dimashpt closed 1 year ago
I finally found out. This is related with grammy-inline-menu. I have to do this:
const menu = new MenuTemplate<MainContext>(async (ctx) => {
// I have to mock async function and return the string to make it works?
const mock = () =>
new Promise<string>((resolve) => {
setTimeout(() => {
resolve('Menu Presensi');
}, 100);
});
const data = await mock();
return data;
});
This is weird behaviour when i don't really need the promise. Any explanations? am i missing something?
@EdJoPaTo do you know? It seems to be related to grammy-inline-menu?
it seems very unlikely that this is the root cause as the body function of a MenuTemplate is just the sendMessage or editMessage text… using async/await will just delay the same method call to a later point…
The code is basically identical to this: const menu = new MenuTemplate<MainContext>('Menu Presensi');
Also the error is hidden via grammy-inline-menu itself when editing the menu so this error happens sometimes but is catched.
I am not sure how conversations work and they might be incompatible with the basic ideas of the grammy-inline-menu library… but in general it works with context filters.
Currently I dont have another idea where the root cause may be…
I guess we cannot really do anything here. I will close this. @dimashpt feel free to reopen with a proper reproduction example of this problem if this is still an issue.
I don’t know how to describe the issue, because it's confusing to me. I have 2 convos, it's all working good. But, when i add 1 more, enter the convo, and reply, i immediatelly get an error that says in session:
Refer to my commit
I'm using TS with nodemon server, after the error, i didn’t get any response and the server says
clean exit - waiting for changes before restart
you can also see my code here
Did i do any mistakes? Thanks