Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.75 KB | None | 0 0
  1. from vkbottle import Bot, Message, VKError
  2. import random
  3. from pyowm import OWM
  4. import time
  5.  
  6. bot = Bot('c73557fca802ae9c71670a437dfe162c911d6e61a28d57f7c0d9a309706c6affb3f4c2a0e6f3690378286', 186487598, debug=True)
  7. # РЕШИ
  8.  
  9. @bot.on.message('реши <what>', lower=True)
  10. async def math(ans: Message, what):
  11. try:
  12. user = await bot.api.users.get(user_ids=ans.from_id)
  13. firstname = user[0]['first_name']
  14. await ans (f'{firstname}, ' + 'Ответ: ' + str(eval(what)))
  15. except:
  16. user = await bot.api.users.get(user_ids=ans.from_id)
  17. firstname = user[0]['first_name']
  18. await ans(f'{firstname}, неверный пример!')
  19.  
  20. # ЭВАЛ
  21.  
  22. @bot.on.message('eval <code>', lower=True)
  23. async def pubg(ans: Message, code):
  24. try:
  25. if ans.from_id != 384319724:
  26. user = await bot.api.users.get(user_ids=ans.from_id)
  27. firstname = user[0]['first_name']
  28. await ans(f'{firstname}, вы не являетесь администратором.')
  29. else:
  30. await ans(eval(code))
  31. except Exception as because:
  32. await ans(f'Traceback (most recent call last): \n{because}')
  33.  
  34.  
  35. @bot.on.message('id', lower=True)
  36. async def wrapper(ans: Message):
  37. try:
  38. if ans.reply_message:
  39. if ans.reply_message.from_id < 0:
  40. await ans(f'Айди сообщества - @club{ans.reply_message.from_id * -1}')
  41. else:
  42. first = await bot.api.users.get(user_ids=ans.from_id)
  43. second = await bot.api.users.get(user_ids=ans.reply_message.from_id, name_case='nom')
  44. second_first = second[0]['first_name']
  45. second_last = second[0]['last_name']
  46. await ans(f'Айди пользователя - {second_first} {second_last} = @id{ans.reply_message.from_id}')
  47. else:
  48. await ans(f'Твой айди - @id{ans.from_id}')
  49. except:
  50. await ans('Неверный синтаксис.')
  51.  
  52. @bot.on.message('bot start', lower=True)
  53. async def start(ans: Message):
  54. user = await bot.api.users.get(user_ids=ans.from_id)
  55. firstname = user[0]['first_name']
  56. await ans(f'⚙ >> {firstname}, loading players 20/100')
  57. time.sleep(0.5)
  58. await ans(f'⚙ >> {firstname}, loading players 60/100')
  59. time.sleep(0.5)
  60. await ans(f'⚙ >> {firstname}, loading players 100/100')
  61. time.sleep(1.5)
  62. await ans(f'⚙ >> {firstname}, loading sqlite3 20/100')
  63. time.sleep(1)
  64. await ans(f'⚙ >> {firstname}, loading sqlite3 60/100')
  65. time.sleep(1)
  66. await ans(f'⚙ >> {firstname}, loading sqlite3 100/100')
  67. time.sleep(0.5)
  68. await ans(f'⚙ >> {firstname}, loading vk_api 20/100')
  69. time.sleep(0.5)
  70. await ans(f'⚙ >> {firstname}, loading vk_api 60/100')
  71. time.sleep(0.5)
  72. await ans(f'⚙ >> {firstname}, loading vk_api 100/100')
  73. time.sleep(3)
  74. await ans(f'⚙ >> {firstname}, bot successfuly loading. Just fun.')
  75.  
  76. # РАЗДЕЛ "РП КОМАНДЫ".
  77.  
  78.  
  79. @bot.on.message('дрочнуть', lower=True)
  80. async def rp(ans: Message):
  81. if ans.reply_message:
  82. if ans.reply_message.from_id < 0:
  83. await ans('Данная команда запрещена к использованию для сообществ.')
  84. else:
  85. first = await bot.api.users.get(user_ids=ans.from_id)
  86. second = await bot.api.users.get(user_ids=ans.reply_message.from_id, name_case='dat')
  87. first_first = first[0]['first_name']
  88. first_last = first[0]['last_name']
  89. second_first = second[0]['first_name']
  90. second_last = second[0]['last_name']
  91. await ans(f'👋👻 >> @id{ans.from_id} ({first_first} {first_last}) подрочил @id{ans.reply_message.from_id} ({second_first} {second_last})')
  92. else:
  93. user = await bot.api.users.get(user_ids=ans.from_id)
  94. firstname = user[0]['first_name']
  95. await ans(f'@id{ans.from_id}({firstname}), но кому?')
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127. # ВЫХОД ИЗ РАЗДЕЛА.
  128.  
  129. if __name__ == '__main__':
  130. bot.run_polling()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement