Fixed sender_chat not being recognized

This commit is contained in:
Profitroll 2023-08-23 10:42:38 +02:00
parent 0e76659511
commit 8eef171391
Signed by: profitroll
GPG Key ID: FA35CAB49DACD3B2
5 changed files with 15 additions and 5 deletions

View File

@ -18,7 +18,9 @@ async def command_ban_failed(app: PyroClient, message: Message):
group = await app.find_group(message.chat.id) group = await app.find_group(message.chat.id)
locale = group.select_locale(app, message.from_user) locale = group.select_locale(app, message.from_user)
if (await app.get_chat_member(group.id, message.from_user.id)).status not in [ if (message.sender_chat is not None and (message.sender_chat.id != group.id)) or (
await app.get_chat_member(group.id, message.from_user.id)
).status not in [
ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.ADMINISTRATOR,
ChatMemberStatus.OWNER, ChatMemberStatus.OWNER,
]: ]:

View File

@ -18,7 +18,9 @@ async def command_language_auto(app: PyroClient, message: Message):
group = await app.find_group(message.chat.id) group = await app.find_group(message.chat.id)
locale = group.select_locale(app, message.from_user) locale = group.select_locale(app, message.from_user)
if (await app.get_chat_member(group.id, message.from_user.id)).status not in [ if (message.sender_chat is not None and (message.sender_chat.id != group.id)) or (
await app.get_chat_member(group.id, message.from_user.id)
).status not in [
ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.ADMINISTRATOR,
ChatMemberStatus.OWNER, ChatMemberStatus.OWNER,
]: ]:

View File

@ -18,7 +18,9 @@ async def command_timeout_join(app: PyroClient, message: Message):
group = await app.find_group(message.chat.id) group = await app.find_group(message.chat.id)
locale = group.select_locale(app, message.from_user) locale = group.select_locale(app, message.from_user)
if (await app.get_chat_member(group.id, message.from_user.id)).status not in [ if (message.sender_chat is not None and (message.sender_chat.id != group.id)) or (
await app.get_chat_member(group.id, message.from_user.id)
).status not in [
ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.ADMINISTRATOR,
ChatMemberStatus.OWNER, ChatMemberStatus.OWNER,
]: ]:

View File

@ -18,7 +18,9 @@ async def command_timeout_verify(app: PyroClient, message: Message):
group = await app.find_group(message.chat.id) group = await app.find_group(message.chat.id)
locale = group.select_locale(app, message.from_user) locale = group.select_locale(app, message.from_user)
if (await app.get_chat_member(group.id, message.from_user.id)).status not in [ if (message.sender_chat is not None and (message.sender_chat.id != group.id)) or (
await app.get_chat_member(group.id, message.from_user.id)
).status not in [
ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.ADMINISTRATOR,
ChatMemberStatus.OWNER, ChatMemberStatus.OWNER,
]: ]:

View File

@ -19,7 +19,9 @@ async def command_language(app: PyroClient, message: Message):
group = await app.find_group(message.chat.id) group = await app.find_group(message.chat.id)
locale = group.select_locale(app, message.from_user) locale = group.select_locale(app, message.from_user)
if (await app.get_chat_member(group.id, message.from_user.id)).status not in [ if (message.sender_chat is not None and (message.sender_chat.id != group.id)) or (
await app.get_chat_member(group.id, message.from_user.id)
).status not in [
ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.ADMINISTRATOR,
ChatMemberStatus.OWNER, ChatMemberStatus.OWNER,
]: ]: