Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added inline button to redirect into haste (w/ texts) #20

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion aiogram_bot/handlers/hastebin.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ async def command_paste(message: types.Message):
url=md.hlink("HasteBin", document_url),
size=len(content),
)
await dst.reply(text, allow_sending_without_reply=True)

reply_markup = types.InlineKeyboardMarkup()
reply_markup.add(types.InlineKeyboardButton(
_("Open paste"),
url=document_url
))

await dst.reply(text, allow_sending_without_reply=True, reply_markup=reply_markup)

for message_to_delete in messages_to_delete:
with suppress(TelegramAPIError):
Expand Down
4 changes: 4 additions & 0 deletions locales/bot.pot
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ msgid ""
"Content size: {size} bytes"
msgstr ""

#: aiogram_bot/handlers/hastebin.py:46
msgid "Open paste"
msgstr ""

#: aiogram_bot/handlers/new_chat_members.py:72
msgid "I'm bot"
msgstr ""
Expand Down