def create_room(message): if RoomRepository.get_by_id(message.text): bot.reply_to(message, 'This name is already used') else: message.db_user.tmp_room = Room(message.text, message.chat.id) UserRepository.set_state(message.db_user.id, CreateRoomBotState.GET_ROOM_DESCRIPTION) bot.reply_to(message, 'Name saved, now add some description')
def create_game(message): if message.db_user.curr_game: bot.reply_to(message, warnings["cant_create_game"]) return # notify_admin_chat(bot, f"User @{message.from_user.username} created new game") game_main_message = bot.send_message(message.chat.id, f"Creating game ...") new_game = dbController.create_game(message.db_user, message.chat.id, game_main_message.message_id) update_main_message(bot, new_game)
def start(message): if not message.db_user: dbController.add_user(message.from_user) # notify_admin_chat(bot, f"User @{message.from_user.username} was added to the db") bot.reply_to( message, f'Hello, {message.from_user.first_name}\n' f'Your id: {message.from_user.id}\n' f'Chat type: {message.chat.type}\n' f'Chat id: {message.chat.id}\n' f'This is template for private chat')
def chat_info(message): bot.reply_to(message, chat_info_text(message))
def game_info(message): game = message.db_user.curr_game if not game: bot.reply_to(message, no_game_info_text()) return bot.send_message(message.chat.id, game_info_text(game), parse_mode="HTML")