mirror of
https://github.com/TeamPGM/PagerMaid_Plugins_Pyro.git
synced 2024-11-16 11:42:15 +00:00
eat 修复错误
This commit is contained in:
parent
1c2569961b
commit
9714b34c76
@ -6,6 +6,7 @@ from os import sep
|
|||||||
from random import randint
|
from random import randint
|
||||||
|
|
||||||
from pyrogram import Client
|
from pyrogram import Client
|
||||||
|
from pyrogram.enums import MessageEntityType
|
||||||
from pyrogram.errors import PeerIdInvalid, UsernameNotOccupied
|
from pyrogram.errors import PeerIdInvalid, UsernameNotOccupied
|
||||||
from pyrogram.types import User, Chat
|
from pyrogram.types import User, Chat
|
||||||
|
|
||||||
@ -225,11 +226,11 @@ async def eat(client_: Client, context: Message):
|
|||||||
else:
|
else:
|
||||||
user = context.sender_chat
|
user = context.sender_chat
|
||||||
if context.entities is not None:
|
if context.entities is not None:
|
||||||
if context.entities[0].type == "text_mention":
|
if context.entities[0].type == MessageEntityType.TEXT_MENTION:
|
||||||
user = context.entities[0].user
|
user = context.entities[0].user
|
||||||
elif context.entities[0].type == "phone_number":
|
elif context.entities[0].type == MessageEntityType.PHONE_NUMBER:
|
||||||
user = int(context.parameter[0])
|
user = int(context.parameter[0])
|
||||||
elif context.entities[0].type == "bot_command":
|
elif context.entities[0].type == MessageEntityType.BOT_COMMAND:
|
||||||
if context.from_user:
|
if context.from_user:
|
||||||
user = context.from_user
|
user = context.from_user
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user