Skip to content

Commit b9539a8

Browse files
committed
fix: correct topic message handling
1 parent 65bf060 commit b9539a8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

anjani/plugins/misc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""miscellaneous bot commands"""
2+
23
# Copyright (C) 2020 - 2023 UserbotIndo Team, <https://github.com/userbotindo.git>
34
#
45
# This program is free software: you can redistribute it and/or modify
@@ -40,8 +41,7 @@ def __init__(self, session: ClientSession, name: str, url: str):
4041
async def __aenter__(self) -> "Paste":
4142
return self
4243

43-
async def __aexit__(self, _: Any, __: Any, ___: Any) -> None:
44-
...
44+
async def __aexit__(self, _: Any, __: Any, ___: Any) -> None: ...
4545

4646
async def go(self, content: Any) -> str:
4747
async with self.__session.post(self.__url, json=content) as r:
@@ -64,8 +64,8 @@ async def cmd_id(self, ctx: command.Context) -> str:
6464
"""Display ID's"""
6565
msg = ctx.msg.reply_to_message or ctx.msg
6666
out_str = f"👥 **Chat ID :** `{(msg.forward_from_chat or msg.chat).id}`\n"
67-
if msg.is_topic_message:
68-
out_str += f"🗨️ **Topic ID :** `{msg.topics.id}`\n"
67+
if msg.topic:
68+
out_str += f"🗨️ **Topic ID :** `{msg.topic.id}`\n"
6969
out_str += f"💬 **Message ID :** `{msg.forward_from_message_id or msg.id}`\n"
7070
if msg.from_user:
7171
out_str += f"🙋‍♂️ **From User ID :** `{msg.from_user.id}`\n"

0 commit comments

Comments
 (0)