aboutsummaryrefslogtreecommitdiff
path: root/helpers.py
diff options
context:
space:
mode:
authorhuker667 <huker@tuta.io>2026-07-09 16:07:31 +0300
committerhuker667 <huker@tuta.io>2026-07-09 16:07:31 +0300
commitee5a6bdcc379527c537e23b689816555832fda5c (patch)
treee6c0d99573a744ea750a821ad7b5cb16ccc242d9 /helpers.py
parentf6109bb91a0dd4bd2558c087752a381d6ffdb4a3 (diff)
downloaduzbekgpt-ee5a6bdcc379527c537e23b689816555832fda5c.tar.gz
uzbekgpt-ee5a6bdcc379527c537e23b689816555832fda5c.tar.bz2
uzbekgpt-ee5a6bdcc379527c537e23b689816555832fda5c.zip
add poll answer support
Diffstat (limited to 'helpers.py')
-rw-r--r--helpers.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/helpers.py b/helpers.py
index e2450f0..d42b315 100644
--- a/helpers.py
+++ b/helpers.py
@@ -1,6 +1,6 @@
import time
-from aiogram.methods import AnswerGuestQuery
+from aiogram.methods import AnswerGuestQuery, SendPoll
from aiogram.types import InlineQueryResultArticle, InputTextMessageContent, Message
from aiogram.enums import ChatType
@@ -88,3 +88,27 @@ async def g_answer(data, message, text, title="da", id="1", parse_mode="Markdown
),
)
)
+
+
+async def answer_poll(
+ data,
+ message,
+ question,
+ options,
+ is_anonymous=True,
+ poll_type="regular",
+ allows_multiple_answers=False,
+ correct_option_id=None,
+ user_id=None
+):
+ return await data["bot"](
+ SendPoll(
+ chat_id=user_id,
+ question=question,
+ options=options,
+ is_anonymous=is_anonymous,
+ type=poll_type,
+ allows_multiple_answers=allows_multiple_answers,
+ correct_option_id=correct_option_id,
+ )
+ )