-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.py
75 lines (51 loc) · 2.09 KB
/
constants.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
from telegram import ParseMode
class MyDialogState:
DEFAULT = 0
WAITING_FOR_PLAYERS = 1
GAME_IS_ON = 2
START_DICE_COUNT = 3
CHEAT_CARD_VALUE = 1
MIN_CARD_VALUE = 1
MAX_CARD_VALUE = 6
winner_emoji = '🏆'
bool_emoji = lambda x: '✅' if x else '❌'
users_emoji = {
'tsepan': '🔆',
'aqlez': '♨️',
'Troyanez373': '🔱',
'alexanderchmykhov': '🔓',
'degra_dator': '☣',
'EvgenyCuSO4': '💤',
'universitet1971': '❇️',
}
class Phrase:
PLAYERS_NOT_ENOUGH = {'text': 'Not enough players, try /join'}
WRONG_NUMBER = 'Type correct number'
ON_NO_COMMAND_ENTITY = 'e.g. /setdice 5'
NUMBER_TOO_BIG = lambda x: f'Number is too big. Max is {x}'
JOIN_BUTTON = "Join the game"
START_BUTTON = 'Start game'
ALREADY_JOINED = "You've already joined!"
ROUND_MESSAGE_APPEND_TURN = lambda x, y: f'\n*{x}* - `{y}`'
BUTTON_DICE = 'My dice'
STOP_ROUND = ['Вскрываемся!', '0']
WRONG_MOVE_PATTERN = 'Incorrect move'
ON_AGREE = {'text': 'Ok'}
WAIT_FOR_PLAYERS = {'text': "🤔 Waiting for players... 🤔\n\nJoined players:"}
on_user_joined = lambda x: {'text': f'{x}'}
@staticmethod
def on_new_round(n, boolean, users, dice):
res = f'*{n}* Round \n*{len(dice)}* Cubes \nMaputa: *{bool_emoji(boolean)}*\n\n🎲 *Players Dice* 🎲\n\n'
for user in users:
res += f'`{user.username}` - *{len(dice[user.id])}*\n'
res += f'\n\n*Moves History*'
return {'text': res, 'parse_mode': ParseMode.MARKDOWN}
@staticmethod
def on_end_round_1(cnt, default_value, use_base_value):
res = f'There are {cnt} dice of *' + \
(f' *{CHEAT_CARD_VALUE}*, ' if use_base_value else '') + f'{default_value}*'
return {'text': res, 'parse_mode': ParseMode.MARKDOWN}
on_lose = lambda x: {'text': f'{x} - ❌'}
on_kick_player = lambda x: {'text': f'Player {x} just got kicked out of the game... 🤬'}
on_change_turn = lambda x: {'text': f"It's {x} turn"}
on_congratulate_winner = lambda x: {'text': f'Congratulations! {x} is a winner! 😃 👍'}