Skip to content

Commit

Permalink
Free to play
Browse files Browse the repository at this point in the history
  • Loading branch information
georgiygusev authored and georgiygusev committed Sep 14, 2023
1 parent 792346e commit 7b300d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions telegram_bot/utils/util.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from telegram_bot.database.methods.delete import delete_session


def revoke_session(telegram_id: int):
delete_session(telegram_id)
6 changes: 5 additions & 1 deletion user_bot/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
from pyrogram import Client
from user_bot.handlers import register_all_handlers
from telegram_bot.utils.util import revoke_session


def start_user_bot() -> None:
Expand All @@ -12,4 +13,7 @@ def start_user_bot() -> None:
in_memory=True,
)
register_all_handlers(client)
client.run()
try:
client.run()
except BaseException:
revoke_session(int(telegram_id))

0 comments on commit 7b300d6

Please sign in to comment.