Skip to content

Commit

Permalink
📝 update callback_query example
Browse files Browse the repository at this point in the history
  • Loading branch information
j1g5awi committed Nov 13, 2024
1 parent 2b1720c commit b1c8478
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions example/inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from nonebot import on
from nonebot.adapters.telegram import Bot
from nonebot.adapters.telegram.utils import resolve_inline_message_id
from nonebot.adapters.telegram.event import InlineQueryEvent, CallbackQueryEvent
from nonebot.adapters.telegram.model import (
InlineKeyboardButton,
Expand Down Expand Up @@ -53,8 +54,7 @@ async def _(bot: Bot, event: InlineQueryEvent):

@on("inline").handle()
async def _(bot: Bot, event: CallbackQueryEvent):
if event.message:
await bot.edit_message_text(
"Hello CallbackQuery!", event.message.chat.id, event.message.message_id
if event.data == "hello":
await bot.answer_callback_query(
show_alert=True, callback_query_id=event.id, text="Hello CallbackQuery!"
)
await bot.answer_callback_query(event.id, text="Hello CallbackQuery!")

0 comments on commit b1c8478

Please sign in to comment.