mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-08 17:13:56 +00:00
1.4 KiB
1.4 KiB
stopPoll
Description
Use this method to stop a poll which was sent by the bot. On success, the stopped Poll with the final results is returned.
Arguments
| Name | Type | Description |
|---|---|---|
chat_id |
#!python3 Union[int, str] |
Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
message_id |
#!python3 int |
Identifier of the original message with the poll |
reply_markup |
#!python3 Optional[InlineKeyboardMarkup] |
Optional. A JSON-serialized object for a new message inline keyboard. |
Response
Type: #!python3 Poll
Description: On success, the stopped Poll with the final results is returned.
Usage
As bot method bot
result: Poll = await bot.stop_poll(...)
Method as object
Imports:
from aiogram.methods import StopPollfrom aiogram.api.methods import StopPollfrom aiogram.api.methods.stop_poll import StopPoll
In handlers with current bot
result: Poll = await StopPoll(...)
With specific bot
result: Poll = await bot(StopPoll(...))
As reply into Webhook in handler
return StopPoll(...)