2019-11-16 22:32:05 +02:00
|
|
|
# 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
|
|
|
|
|
|
|
|
|
|
```python3
|
|
|
|
|
result: Poll = await bot.stop_poll(...)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Method as object
|
|
|
|
|
|
|
|
|
|
Imports:
|
|
|
|
|
|
2019-12-11 16:52:21 +02:00
|
|
|
- `from aiogram.methods import StopPoll`
|
|
|
|
|
- `from aiogram.api.methods import StopPoll`
|
|
|
|
|
- `from aiogram.api.methods.stop_poll import StopPoll`
|
2019-11-16 22:32:05 +02:00
|
|
|
|
2020-01-11 22:59:14 +02:00
|
|
|
#### In handlers with current bot
|
2019-11-16 22:32:05 +02:00
|
|
|
```python3
|
2020-01-11 22:59:14 +02:00
|
|
|
result: Poll = await StopPoll(...)
|
2019-11-16 22:32:05 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
#### With specific bot
|
|
|
|
|
```python3
|
2020-01-11 22:59:14 +02:00
|
|
|
result: Poll = await bot(StopPoll(...))
|
2019-11-16 22:32:05 +02:00
|
|
|
```
|
2020-01-11 22:59:14 +02:00
|
|
|
#### As reply into Webhook in handler
|
2019-11-16 22:32:05 +02:00
|
|
|
```python3
|
2020-01-11 22:59:14 +02:00
|
|
|
return StopPoll(...)
|
2019-11-16 22:32:05 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2020-01-11 22:59:14 +02:00
|
|
|
|
2019-11-16 22:32:05 +02:00
|
|
|
## Related pages:
|
|
|
|
|
|
|
|
|
|
- [Official documentation](https://core.telegram.org/bots/api#stoppoll)
|
|
|
|
|
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
|
|
|
|
- [aiogram.types.Poll](../types/poll.md)
|