Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. @bot.on.message_chat('реши <what>')
  2. @bot.on.message_chat('Реши <what>')
  3. async def math(ans: Message, what):
  4. try:
  5. user = await bot.api.users.get(user_ids=ans.from_id)
  6. firstname = user[0]['first_name']
  7. await ans (f'{firstname}, ' + 'Ответ: ' + str(eval(what)))
  8. except:
  9. user = await bot.api.users.get(user_ids=ans.from_id)
  10. firstname = user[0]['first_name']
  11. await ans(f'{firstname}, неверный пример!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement