-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandlers.py
60 lines (43 loc) · 1.68 KB
/
handlers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import asyncio
from random import randint, choice
from tarantool_utils import space_default, space_prophecy, space_color, space_number
async def default_command(bot, event):
await sleep_send(bot, event)
await bot.send_text(
chat_id=event.from_chat,
text=choice(space_default.select())[1]
)
async def sleep_send(bot, event):
await bot.send_actions(chat_id=event.data['chat']['chatId'], actions='typing')
await asyncio.sleep(2)
async def rand_prophecy(bot, event):
await sleep_send(bot, event)
await bot.send_text(
chat_id=event.from_chat,
text=choice(space_prophecy.select())[1]
)
async def rand_number(bot, event):
await sleep_send(bot, event)
await bot.send_text(
chat_id=event.from_chat,
text=choice(space_number.select())[1] + ' ' + str(randint(1, 100))
)
async def rand_color(bot, event):
await sleep_send(bot, event)
await bot.send_text(
chat_id=event.from_chat,
text=choice(space_color.select('start', index='type'))[2] + ' ' + choice(space_color.select('end', index='type'))[2]
)
async def start(bot, event):
await bot.send_text(
chat_id=event.from_chat,
text="""https://files.icq.net/get/09B9B000fg6W7luRnYpszQ5f85dcbe1ae
Приветствую тебя! 🧙🏼♀️
Я — нейрогадалка. Задавай вопрос, на который можно ответить да/нет или напиши «погадай».
Погадаю, расскажу, что знаю, что вижу. А вижу я многое…. 👁"""
)
async def media(bot, event):
await bot.send_text(
chat_id=event.from_chat,
text="Пришли, пожалуйста, текстовое сообщение"
)