parent
173c9b8db7
commit
5336975f1d
@ -5,7 +5,7 @@ from struct import error as StructError
|
|||||||
from telethon.tl.functions.messages import GetCommonChatsRequest
|
from telethon.tl.functions.messages import GetCommonChatsRequest
|
||||||
from telethon.tl.functions.users import GetFullUserRequest
|
from telethon.tl.functions.users import GetFullUserRequest
|
||||||
from telethon.tl.functions.channels import DeleteUserHistoryRequest
|
from telethon.tl.functions.channels import DeleteUserHistoryRequest
|
||||||
from telethon.tl.types import MessageEntityMentionName, ChannelParticipantsAdmins
|
from telethon.tl.types import MessageEntityMentionName, ChannelParticipantsAdmins, MessageEntityPhone
|
||||||
from telethon.errors.rpcerrorlist import UserAdminInvalidError, ChatAdminRequiredError, FloodWaitError
|
from telethon.errors.rpcerrorlist import UserAdminInvalidError, ChatAdminRequiredError, FloodWaitError
|
||||||
from asyncio import sleep
|
from asyncio import sleep
|
||||||
from random import uniform
|
from random import uniform
|
||||||
@ -60,6 +60,8 @@ async def span_ban(context):
|
|||||||
if context.message.entities is not None:
|
if context.message.entities is not None:
|
||||||
if isinstance(context.message.entities[0], MessageEntityMentionName):
|
if isinstance(context.message.entities[0], MessageEntityMentionName):
|
||||||
user = context.message.entities[0].user_id
|
user = context.message.entities[0].user_id
|
||||||
|
elif isinstance(context.message.entities[0], MessageEntityPhone):
|
||||||
|
user = int(context.parameter[0])
|
||||||
else:
|
else:
|
||||||
await context.edit(f"{lang('error_prefix')}{lang('arg_error')}")
|
await context.edit(f"{lang('error_prefix')}{lang('arg_error')}")
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user