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

Set Custom URL for Multiple Games #1420

Open
2 tasks done
0xSaurabhx opened this issue Feb 17, 2024 · 0 comments
Open
2 tasks done

Set Custom URL for Multiple Games #1420

0xSaurabhx opened this issue Feb 17, 2024 · 0 comments
Labels
2.x Issue or PR for legacy 2.x version bug Something is wrong with the framework

Comments

@0xSaurabhx
Copy link

Checklist

  • I am sure the error is coming from aiogram code
  • I have searched in the issue tracker for similar bug reports, including closed ones

Operating system

Ubuntu 20.04

Python version

3.8.10

aiogram version

2.25.1

Expected behavior

there should be any way to set custom url for each games

Current behavior

i get error if i try to use any method

Steps to reproduce

set game shortname, bot token.
then bot = Bot(token=token)
dp = Dispatcher(bot, storage=MemoryStorage())
start msg handler
game command:
@dp.callback_query_handler(lambda c: c.data and c.data.startswith('game'))
async def process_callback(callback_query: types.CallbackQuery):
await bot.answer_callback_query(callback_query.id, url=url)
......

Code example

@dp.inline_handler()
async def inline_query_handler(inline_query: types.InlineQuery):
    games = [
        types.InlineQueryResultGame(
            id='game1',
            game_short_name='demo1'
        ),
        types.InlineQueryResultGame(
            id='game2',
            game_short_name='demo2'
        ),

    ]

    await bot.answer_inline_query(inline_query.id, results=games)

Logs

No response

Additional information

No response

@0xSaurabhx 0xSaurabhx added the bug Something is wrong with the framework label Feb 17, 2024
@Olegt0rr Olegt0rr added the 2.x Issue or PR for legacy 2.x version label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issue or PR for legacy 2.x version bug Something is wrong with the framework
Projects
None yet
Development

No branches or pull requests

2 participants