This issue happen only when the bot is admin of a channel, if the bot is admin of a group the bug isn't happening. Anyway, the problem is on that method:
getSessionKey(ctx) {
// if ctx has chat object, we use chat.id
// if ctx has callbackquery object, we use cb.chat_instance
// if ctx does not have any of the fields mentioned above, we use from.id
const id = ctx.chat ? ctx.chat.id : (ctx.callbackQuery ? ctx.callbackQuery.chat_instance : ctx.from.id);
return `${id}:${ctx.from.id}`;
}
specifically here: return${id}:${ctx.from.id};
don't know why you did this, you should return only id 'cause in channel ctx.from.id is undefined
This issue happen only when the bot is admin of a channel, if the bot is admin of a group the bug isn't happening. Anyway, the problem is on that method:
specifically here:
return
${id}:${ctx.from.id};
don't know why you did this, you should return only
id
'cause in channelctx.from.id
isundefined