Skip to content

Commit

Permalink
Fix incase userbot failed to start
Browse files Browse the repository at this point in the history
  • Loading branch information
yasirarism committed Sep 7, 2024
1 parent 52f7d6e commit 5e36957
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ SUPPORT_CHAT=YasirPediaChannel
COMMAND_HANDLER=
USER_SESSION=
OPENAI_API=
BARD_API=
GOOGLEAI_API=
CURRENCY_API=
14 changes: 10 additions & 4 deletions misskaty/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,16 @@
BOT_NAME = app.me.first_name
BOT_USERNAME = app.me.username
if USER_SESSION:
user.start()
UBOT_ID = user.me.id
UBOT_NAME = user.me.first_name
UBOT_USERNAME = user.me.username
try:
user.start()
UBOT_ID = user.me.id
UBOT_NAME = user.me.first_name
UBOT_USERNAME = user.me.username
except Exception as e:
app.log.error(f"Error while starting UBot: {e}")
UBOT_ID = None
UBOT_NAME = None
UBOT_USERNAME = None
else:
UBOT_ID = None
UBOT_NAME = None
Expand Down

0 comments on commit 5e36957

Please sign in to comment.