Spaces:
Running
Running
BinaryONe
commited on
Commit
·
83cf287
1
Parent(s):
fcdb8e5
Adding Poll In Upload
Browse files
FileStream/bot/plugins/FileHandlers/callback.py
CHANGED
@@ -5,11 +5,12 @@ import datetime
|
|
5 |
from pyrogram import filters, Client, raw, types,enums
|
6 |
from pyrogram.errors import FloodWait
|
7 |
from pyrogram.raw import functions
|
8 |
-
from pyrogram.raw.base import PollAnswer
|
9 |
from pyrogram.enums.parse_mode import ParseMode
|
10 |
from pyrogram.file_id import FileId, FileType, PHOTO_TYPES
|
11 |
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery, WebAppInfo
|
12 |
-
from pyrogram.raw.types import KeyboardButtonSimpleWebView,InputMediaPoll
|
|
|
13 |
#-------------------------Local Imports -----------------------------------#
|
14 |
from FileStream import __version__
|
15 |
from FileStream.Database import Database
|
@@ -134,7 +135,7 @@ async def cb_data(bot: Client, update: CallbackQuery):
|
|
134 |
response_id = int(usr_cmd[3])
|
135 |
message = await FileStream.get_messages(user_id, message_id)
|
136 |
response = await FileStream.get_messages(user_id, response_id)
|
137 |
-
print("Response Update:",update,f"Message ID:{response_id}")
|
138 |
instruction = {
|
139 |
"privacy_type": "PUBLIC",
|
140 |
"user_id": user_id,
|
@@ -176,23 +177,32 @@ async def cb_data(bot: Client, update: CallbackQuery):
|
|
176 |
message_id=response_id,
|
177 |
media=InputMediaPoll(
|
178 |
poll=Poll(
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
PollAnswer(text="WebSeries"),
|
184 |
-
PollAnswer(text="Anime"),
|
185 |
-
PollAnswer(text="Documentary"),
|
186 |
-
PollAnswer(text="Regular")
|
187 |
-
],
|
188 |
-
multiple_choice=True,
|
189 |
-
quiz=False,
|
190 |
)
|
191 |
),
|
192 |
)
|
193 |
print("Update:",update)
|
194 |
"""
|
195 |
PollAnswer(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
await FileStream.send_poll(
|
197 |
type= enums.PollType.REGULAR,
|
198 |
reply_to_message_id=message_id,
|
|
|
5 |
from pyrogram import filters, Client, raw, types,enums
|
6 |
from pyrogram.errors import FloodWait
|
7 |
from pyrogram.raw import functions
|
8 |
+
from pyrogram.raw.base import PollAnswer, Poll
|
9 |
from pyrogram.enums.parse_mode import ParseMode
|
10 |
from pyrogram.file_id import FileId, FileType, PHOTO_TYPES
|
11 |
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery, WebAppInfo
|
12 |
+
from pyrogram.raw.types import KeyboardButtonSimpleWebView,InputMediaPoll
|
13 |
+
#from pyrogram.raw.types import Poll
|
14 |
#-------------------------Local Imports -----------------------------------#
|
15 |
from FileStream import __version__
|
16 |
from FileStream.Database import Database
|
|
|
135 |
response_id = int(usr_cmd[3])
|
136 |
message = await FileStream.get_messages(user_id, message_id)
|
137 |
response = await FileStream.get_messages(user_id, response_id)
|
138 |
+
#print("Response Update:",update,f"Message ID:{response_id}")
|
139 |
instruction = {
|
140 |
"privacy_type": "PUBLIC",
|
141 |
"user_id": user_id,
|
|
|
177 |
message_id=response_id,
|
178 |
media=InputMediaPoll(
|
179 |
poll=Poll(
|
180 |
+
type= enums.PollType.REGULAR,
|
181 |
+
question="Is this a poll question?",
|
182 |
+
options=["Movie", "WebSeries", "Anime", "Documentary", "Regular"],
|
183 |
+
allows_multiple_answers=True,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
)
|
185 |
),
|
186 |
)
|
187 |
print("Update:",update)
|
188 |
"""
|
189 |
PollAnswer(
|
190 |
+
id=FileStream.rnd_id(),
|
191 |
+
question="Is this a poll question?",
|
192 |
+
answers=["Movie","WebSeries"),
|
193 |
+
PollAnswer(text="Anime"),
|
194 |
+
PollAnswer(text="Documentary"),
|
195 |
+
PollAnswer(text="Regular")
|
196 |
+
],
|
197 |
+
multiple_choice=True,
|
198 |
+
quiz=False,
|
199 |
+
answers=[
|
200 |
+
PollAnswer("Movie"),
|
201 |
+
PollAnswer(text="WebSeries"),
|
202 |
+
PollAnswer(text="Anime"),
|
203 |
+
PollAnswer(text="Documentary"),
|
204 |
+
PollAnswer(text="Regular")
|
205 |
+
],
|
206 |
await FileStream.send_poll(
|
207 |
type= enums.PollType.REGULAR,
|
208 |
reply_to_message_id=message_id,
|