Fixed sender_chat not being recognized
This commit is contained in:
parent
0e76659511
commit
8eef171391
@ -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,
|
||||||
]:
|
]:
|
||||||
|
@ -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,
|
||||||
]:
|
]:
|
||||||
|
@ -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,
|
||||||
]:
|
]:
|
||||||
|
@ -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,
|
||||||
]:
|
]:
|
||||||
|
@ -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,
|
||||||
]:
|
]:
|
||||||
|
Reference in New Issue
Block a user