-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
95 lines (82 loc) · 3.95 KB
/
config.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# -*- coding: utf-8 -*-
from enum import Enum
import os
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.environ['token']
database_name = "music.db" # Файл с базой данных SQLite
db_file = "database.vdb" # Файл с базой данных Vedis
shelve_name = "shelve.db" # Файл с базой данных Shelve
class States(Enum):
S_BEFORE_START = "0" # пользователь играет впервые или в очередной раз; лучше S_NEW_GAME
S_START = "1" # начало диалога перед 1-м туром
S_ENTER_NAME = "2" # ввод имени пользователем (ожидаем его)
S_ENTER_PERFORMER = "3" # ввод любимого исполнителя
S_ENTER_CATEGORY = "4" # ввод категории
S_ENTER_NOTE = "5"
S_ENTER_ANSWER = "6" # выбор варианта ответа
game_messages = {
'1.4': [
'Был у нас во дворе один',
'Не ожидал, что ваш любимый исполнитель',
],
'1.5': ['Начинаем игру',
'Ну что ж, начнём-с',
],
'1.6': [
'Выбирайте категорию',
"'Категории, ау', выбирайте",
],
'1.6.1': [
'Увы, ноты закончились( Выберите другую категорию',
'Категория разыграна! Выберите другую',
],
'1.7': [
'Выберите ноту',
'Номер ноты?',
'Ваш дальнейший выбор',
],
'1.7.1': [
'Нота прозвучала! Выберите другую',
'По-моему, вы уже её слушали..',
],
'1.8.1': [
'Совершенно верно!',
'Правильный ответ',
'Засчитываю ответ как верный',
],
'1.8.2': [
'Было близко, пока не правильно',
'Увы, Вы не угадали(:',
],
'1.10.1': [
'Продолжаем, ваш выбор',
'Выберите категорию',
],
'1.10.2': [
'Игра завершена! До встречи)',
'Усё! Жду вас в новой игре!',
],
}
# Заголовки для формирования сообщений со статистикой
stat_ = {
0: "Лидеры по количеству баллов",
1: "Самые эффективные игроки\n(максимум баллов при минимуме игр)",
2: "Самые точные игроки",
}
# Описание команд, которые доступны пользователю
commands = {
'start' : 'начать игру',
'statistics' : 'показать статистику',
'help' : 'доступные команды для бота',
'rules' : 'описание игры',
}
rules_text = '''
По команде /start происходит начало новой или очередной игры.
Далее игроку предлагается табло категорий,
где за каждой из них скрываются 'ноты' - короткие музыкальные композиции,
мелодии которых и предлагается угадать:)
Выбирайте категорию, затем ноту (после её выбора будет объявлена цена), далее попытайтесь угадать трек.
В случае успешной или неудачной попытки, бот сообщит об этом, и запишет <s>или вычтет</s> цену ноты при подсчёте баллов на ваш счёт. \n
Начинайте и выигрывайте!
'''