Skip to content

Commit

Permalink
fix: start
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Trotsenko committed Jul 20, 2023
1 parent f563e46 commit 4d80729
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,23 @@ async def start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
"""Send a message when the command /start is issued."""
chat_id = update.message.chat_id

db.connect(reuse_if_open=True)
# db.connect(reuse_if_open=True)

if chat_exists(chat_id=chat_id):
await context.bot.send_message(

# db.close()
return await context.bot.send_message(
text="Бот уже инициализорован. Принять учатие можно с помощью команды /play, кидать снежки /throw",
chat_id=chat_id
)
else:
create_chat(chat_id=chat_id)

await context.bot.send_message(
# db.close()
return await context.bot.send_message(
text="Отлично, игра началась. Принять учатие можно с помощью команды /play, кидать снежки /throw",
chat_id=chat_id
)
db.close()

async def help_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
"""Send a message when the command /help is issued."""
Expand Down

0 comments on commit 4d80729

Please sign in to comment.