Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async def search_user(bot, pattern: str) -> int:
- if pattern.isdigit():
- return int(pattern)
- elif 'vk.com/' in pattern:
- uid = (await bot.api.users.get(
- user_ids=pattern.split('/')[-1]
- ))[0]
- return uid['id']
- elif '[id' in pattern:
- uid = pattern.split("|")[0]
- return int(uid.replace("[id", ""))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement