Closed martroi closed 7 years ago
Closing the issue (there was no issue). The confusion is in the code below, where the variable bot in fact is used to carry a chat instance, and what I indicated as missing data is therefore at self.bot.message
class CallbackQuery: def init(self, bot, src): self.bot = bot self.query_id = src['id'] self.data = src['data']
When you receive a CallbackQuery (when you press a button in an inline keyboard), you only get access to 'query_id' and 'data', but not to 'chat_instance', 'from' and 'message' data. This means that many users at many chats can be pressing these buttons and you don't know where it comes from. Looking at class CallbackQuery.init all the information is in the src variable, which is not preserved after the init, so I propose that you add there something like self.chat_instance=src['chatinstance'], self.from = src['from'] and self.message=src['message'] (and possibly the complete self.src = src) to preserve all the information.