Skip to content

Commit

Permalink
fix for users with @ in their bot username
Browse files Browse the repository at this point in the history
  • Loading branch information
xditya authored Jan 7, 2021
1 parent 984be0e commit 530454a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion telebot/plugins/mybot/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ async def settings(event):
async def settings(event):
if event.sender_id == OWNER_ID:
await event.delete()
ok = Var.TG_BOT_USER_NAME_BF_HER
if ok.startswith('@'):
ok = ok.split('@')[1]
await tgbot.send_message(event.chat_id,
"Here are the available options.",
buttons=[
Expand All @@ -201,7 +204,7 @@ async def settings(event):
[Button.inline(
"Customs", data="custom")],
[Button.url(
"Logs", url=f"https://t.me/{Var.TG_BOT_USER_NAME_BF_HER}?start=logs")]
"Logs", url=f"https://t.me/{ok}?start=logs")]
])
else:
await event.answer("You can't use this bot.", alert=True)
Expand Down

0 comments on commit 530454a

Please sign in to comment.