question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unable to create web_app button

See original GitHub issue

Good afternoon, an update has recently been released in telegram and added web_app buttons. leading to the “site” in the telegram itself, the documentation says that you need to import the script to the page and create a button in the bot

Html:

<html><head>
<script src="https://telegram.org/js/telegram-web-app.js"></script>
</head></html>

code for sending a message with a button:

from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from aiogram.types.web_app_info import WebAppInfo
await msg.reply("test", reply_markup=InlineKeyboardMarkup().add(InlineKeyboardButton(text="test", web_app=WebAppInfo(url="https://test_link"))))

Error:

Button_type_invalid

thanks in advance for your help)

Source: https://stackoverflow.com/questions/71914783/unable-to-create-web-app-button-aiogram

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
NQUARExcommented, Apr 19, 2022

Oh my God, you won’t believe it, but it worked! Nothing worked with the same code yesterday. Magic! Here is the code I tested:

from aiogram import Bot, Dispatcher, executor, types
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from aiogram.types.web_app_info import WebAppInfo

API_TOKEN = 'your bot api token'

bot = Bot(token=API_TOKEN)
dp = Dispatcher(bot)

@dp.message_handler(commands="start")
async def cmd_start(message: types.Message):
	await message.answer("test", reply_markup=InlineKeyboardMarkup().add(InlineKeyboardButton(text="test", web_app=WebAppInfo(url="https://github.com/aiogram/aiogram/issues/891"))))

if __name__ == '__main__':
    executor.start_polling(dp, skip_updates=True)
0reactions
NQUARExcommented, Apr 19, 2022

Thanks.

Magic…

Read more comments on GitHub >

github_iconTop Results From Across the Web

New Web Application button disabled
Open up IE as administrator and navigate to your central admin page. Now navigate to "Manage Web Applications" and the "New" option will...
Read more >
python - unable to create web_app button aiogram
Try it like this, everything worked for me, although yesterday I also encountered this error, it's strange. Run this code with your API ......
Read more >
New Web Application Greyed Out SharePoint 2016 - SPGeeks
In this post, we will be fixing New web application greyed out SharePoint 2016 that you may face when creating a new web...
Read more >
Problem: Unable to save edits in Web AppBuilder for ArcGIS
This enables the Save button to save edits made to the web app. In the web app page, select another theme and click...
Read more >
Cannot create a new message from Outlook Web App
When you select the New button to create a new message in Microsoft Outlook Web App (OWA) in Microsoft 365, no message window...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found