🐛 Fix the incorrect parameter passing

This commit is contained in:
洛水居室 2023-03-14 15:13:22 +08:00
parent a9b76ac187
commit 913e566f5e
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -277,7 +277,7 @@ class Post(Plugin.Conversation):
channel_id = -1 channel_id = -1
try: try:
for channel_chat_id in config.channels: for channel_chat_id in config.channels:
chat = await self.get_chat(chat_id=channel_id) chat = await self.get_chat(chat_id=channel_chat_id)
if message.text == chat.username: if message.text == chat.username:
channel_id = channel_chat_id channel_id = channel_chat_id
except KeyError as exc: except KeyError as exc:
@ -339,7 +339,7 @@ class Post(Plugin.Conversation):
channel_name = None channel_name = None
try: try:
for channel_info in config.channels: for channel_info in config.channels:
if post_handler_data.channel_id == channel_info.chat_id: if post_handler_data.channel_id == channel_info:
chat = await self.get_chat(chat_id=channel_id) chat = await self.get_chat(chat_id=channel_id)
channel_name = chat.username channel_name = chat.username
except KeyError as exc: except KeyError as exc: