Skip to content

Commit

Permalink
Added example for poll
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-nikolaev committed May 19, 2024
1 parent 9617f50 commit dd4d08f
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions example_poll.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import asyncio
import os

from aiogram import Bot
from aiogram.client.default import DefaultBotProperties

from sulguk import SULGUK_PARSE_MODE, AiogramSulgukMiddleware

CHAT_ID = 1


async def main():
bot = Bot(
token=os.getenv("BOT_TOKEN"),
default=DefaultBotProperties(parse_mode=SULGUK_PARSE_MODE),
)
bot.session.middleware(AiogramSulgukMiddleware())

await bot.send_poll(
CHAT_ID,
question="Do you like Python?",
options=[
"Yes!",
"No",
"Probably...",
],
explanation="You like.",
correct_option_id=0,
type="quiz",
)


if __name__ == "__main__":
asyncio.run(main())

0 comments on commit dd4d08f

Please sign in to comment.