Spaces:
Running
Running
BinaryONe
commited on
Commit
·
4f1c0a3
1
Parent(s):
17a5adc
changes In Upload
Browse files
FileStream/bot/plugins/FileHandlers/callback.py
CHANGED
@@ -138,6 +138,17 @@ async def cb_data(bot: Client, update: CallbackQuery):
|
|
138 |
file_caption = getattr(message, "caption", f"{get_name(message)}" ) or "None/Unknown"
|
139 |
file_name = get_name(message)
|
140 |
print("Daetail",file_caption,"\nFile:",file_name)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
await FileStream.send_poll(
|
142 |
type= enums.PollType.REGULAR,
|
143 |
reply_to_message_id=message_id,
|
@@ -146,7 +157,7 @@ async def cb_data(bot: Client, update: CallbackQuery):
|
|
146 |
allows_multiple_answers=True,
|
147 |
chat_id=user_id
|
148 |
)
|
149 |
-
|
150 |
#type=enums.PollType.QUIZ,
|
151 |
print(polls)
|
152 |
file_info = get_file_info(message, instruction)
|
|
|
138 |
file_caption = getattr(message, "caption", f"{get_name(message)}" ) or "None/Unknown"
|
139 |
file_name = get_name(message)
|
140 |
print("Daetail",file_caption,"\nFile:",file_name)
|
141 |
+
await message.EditMessage(
|
142 |
+
peer=user_id,
|
143 |
+
id=message_id,
|
144 |
+
media=types.InputMediaPoll(
|
145 |
+
poll=types.Poll(
|
146 |
+
question="Is this a poll question?",
|
147 |
+
answers=["Movie", "WebSeries", "Anime", "Documentary", "Regular"]
|
148 |
+
)
|
149 |
+
),
|
150 |
+
)
|
151 |
+
"""
|
152 |
await FileStream.send_poll(
|
153 |
type= enums.PollType.REGULAR,
|
154 |
reply_to_message_id=message_id,
|
|
|
157 |
allows_multiple_answers=True,
|
158 |
chat_id=user_id
|
159 |
)
|
160 |
+
|
161 |
#type=enums.PollType.QUIZ,
|
162 |
print(polls)
|
163 |
file_info = get_file_info(message, instruction)
|
FileStream/bot/plugins/FileHandlers/polls.py
CHANGED
@@ -3,8 +3,7 @@ from FileStream.bot import FileStream
|
|
3 |
|
4 |
@FileStream.on_poll()
|
5 |
def handle_poll(FileStream, poll):
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
print(f"
|
10 |
-
#app.loop.create_task(poll_handler(client, poll))
|
|
|
3 |
|
4 |
@FileStream.on_poll()
|
5 |
def handle_poll(FileStream, poll):
|
6 |
+
user_id = poll_answer.user.id
|
7 |
+
poll_id = poll_answer.poll_id
|
8 |
+
option_ids = poll_answer.option_ids
|
9 |
+
print(f"User {user_id} voted in poll {poll_id} for options {option_ids}")
|
|