Skip to content

Commit

Permalink
fix: tgbot links long text error
Browse files Browse the repository at this point in the history
  • Loading branch information
erfjab committed Jul 17, 2024
1 parent a353035 commit 32d1865
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/telegram/handlers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,9 @@ def links_command(call: types.CallbackQuery):

text = f"<code>{user.subscription_url}</code>\n\n\n"
for link in user.links:
text += f"<code>{link}</code>\n\n"
if len(text) > 4056 :
text += '\n\n<b>...</b>'
break

bot.edit_message_text(
text,
Expand Down Expand Up @@ -713,6 +715,9 @@ def genqr_command(call: types.CallbackQuery):

text = f"<code>{user.subscription_url}</code>\n\n\n"
for link in user.links:
if len(text) > 4056 :
text += '\n\n<b>...</b>'
break
text += f"<code>{link}</code>\n\n"

bot.send_message(
Expand Down

0 comments on commit 32d1865

Please sign in to comment.