2
0
mirror of https://github.com/Nick80835/microbot synced 2025-08-31 06:26:04 +00:00

sorta support topics

This commit is contained in:
Nick80835
2022-11-26 12:37:59 -05:00
parent 82d38600b5
commit c6f5151fdc
2 changed files with 11 additions and 2 deletions

View File

@@ -49,3 +49,12 @@ class ExtendedEvent(NewMessage.Event):
if size_attr and ((size_attr[0].w == 512 and size_attr[0].h <= 512) or (size_attr[0].w <= 512 and size_attr[0].h == 512)):
return reply.sticker
async def respond(self, *args, **kwargs):
if self.reply_to and self.reply_to.forum_topic and not kwargs.get("reply_to", None):
if self.reply_to.reply_to_top_id:
return await self.message.respond(*args, **kwargs|{"reply_to": self.reply_to.reply_to_top_id})
elif self.reply_to.reply_to_msg_id:
return await self.message.respond(*args, **kwargs|{"reply_to": self.reply_to.reply_to_msg_id})
return await self.message.respond(*args, **kwargs)

View File

@@ -16,8 +16,8 @@ async def supernekoatsume(event):
nekotype = event.object.pattern
as_file = bool(event.other_args[0])
if nekotype in REPLY_TYPES:
reply_to = await event.get_reply_message() or event
if nekotype in REPLY_TYPES and event.is_reply:
reply_to = await event.get_reply_message()
else:
reply_to = event