Fix CallbackQuery.edit for normal queries (0b4d649)

This commit is contained in:
Lonami Exo 2019-04-02 08:37:24 +02:00
parent 3398bee77a
commit 38900c5079

View File

@ -264,9 +264,15 @@ class CallbackQuery(EventBuilder):
since the message object is normally not present.
"""
self._client.loop.create_task(self.answer())
return await self._client.edit_message(
self.query.msg_id, *args, **kwargs
)
if isinstance(self.query.msg_id, types.InputBotInlineMessageID):
return await self._client.edit_message(
self.query.msg_id, *args, **kwargs
)
else:
return await self._client.edit_message(
await self.get_input_chat(), self.query.msg_id,
*args, **kwargs
)
async def delete(self, *args, **kwargs):
"""