Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. @bot.on.message_chat('id')
  2. @bot.on.message_chat('Id')
  3. async def wrapper(ans: Message):
  4. try:
  5. if ans.reply_message:
  6. if ans.reply_message.from_id < 0:
  7. await ans(f'Айди сообщества - @club{ans.reply_message.from_id * -1}')
  8. else:
  9. first = await bot.api.users.get(user_ids=ans.from_id)
  10. second = await bot.api.users.get(user_ids=ans.reply_message.from_id, name_case='nom')
  11. second_first = second[0]['first_name']
  12. second_last = second[0]['last_name']
  13. await ans(f'Айди пользователя - {second_first} {second_last} = @id{ans.reply_message.from_id}')
  14. else:
  15. await ans(f'Твой айди - @id{ans.from_id}')
  16. except:
  17. await ans('Неверный синтаксис.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement