Update FileStream/bot/plugins/FileHandlers/callback.py
Browse files
FileStream/bot/plugins/FileHandlers/callback.py
CHANGED
|
@@ -110,7 +110,9 @@ async def cb_data(bot: Client, update: CallbackQuery):
|
|
| 110 |
try:
|
| 111 |
user_id = str(usr_cmd[1])
|
| 112 |
message_id = int(usr_cmd[2])
|
|
|
|
| 113 |
message = await FileStream.get_messages(user_id, message_id)
|
|
|
|
| 114 |
instruction = {
|
| 115 |
"privacy_type": "PUBLIC",
|
| 116 |
"user_id": user_id,
|
|
@@ -119,8 +121,15 @@ async def cb_data(bot: Client, update: CallbackQuery):
|
|
| 119 |
file_caption = getattr(message, "caption", f"{get_name(message)}" ) or "None/Unknown"
|
| 120 |
file_name = get_name(message)
|
| 121 |
print("Daetail",file_caption,file_name)
|
| 122 |
-
await FileStream.send_poll(
|
| 123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
|
| 125 |
except Exception as e:
|
| 126 |
print(f"An error occurred: {str(e)}")
|
|
@@ -172,7 +181,7 @@ async def cb_data(bot: Client, update: CallbackQuery):
|
|
| 172 |
)
|
| 173 |
),
|
| 174 |
)
|
| 175 |
-
|
| 176 |
print("Poll function and all initializers executed successfully.")
|
| 177 |
print("dir(Poll):", dir(Poll))
|
| 178 |
print("Poll.__init__:", Poll.__init__)
|
|
@@ -202,7 +211,7 @@ async def cb_data(bot: Client, update: CallbackQuery):
|
|
| 202 |
)
|
| 203 |
)
|
| 204 |
print("Update:",update)
|
| 205 |
-
|
| 206 |
PollAnswer(
|
| 207 |
id=FileStream.rnd_id(),
|
| 208 |
question="Is this a poll question?",
|
|
|
|
| 110 |
try:
|
| 111 |
user_id = str(usr_cmd[1])
|
| 112 |
message_id = int(usr_cmd[2])
|
| 113 |
+
response_id = int(usr_cmd[3])
|
| 114 |
message = await FileStream.get_messages(user_id, message_id)
|
| 115 |
+
response = await FileStream.get_messages(user_id, response_id)
|
| 116 |
instruction = {
|
| 117 |
"privacy_type": "PUBLIC",
|
| 118 |
"user_id": user_id,
|
|
|
|
| 121 |
file_caption = getattr(message, "caption", f"{get_name(message)}" ) or "None/Unknown"
|
| 122 |
file_name = get_name(message)
|
| 123 |
print("Daetail",file_caption,file_name)
|
| 124 |
+
await FileStream.send_poll(
|
| 125 |
+
type= enums.PollType.REGULAR,
|
| 126 |
+
reply_to_message_id=message_id,
|
| 127 |
+
explanation=f"{message_id}_{response_id}",
|
| 128 |
+
question="Is this a poll question?",
|
| 129 |
+
options=["Movie", "WebSeries", "Anime", "Documentary", "Regular"],
|
| 130 |
+
allows_multiple_answers=True,
|
| 131 |
+
chat_id=user_id
|
| 132 |
+
)
|
| 133 |
|
| 134 |
except Exception as e:
|
| 135 |
print(f"An error occurred: {str(e)}")
|
|
|
|
| 181 |
)
|
| 182 |
),
|
| 183 |
)
|
| 184 |
+
|
| 185 |
print("Poll function and all initializers executed successfully.")
|
| 186 |
print("dir(Poll):", dir(Poll))
|
| 187 |
print("Poll.__init__:", Poll.__init__)
|
|
|
|
| 211 |
)
|
| 212 |
)
|
| 213 |
print("Update:",update)
|
| 214 |
+
|
| 215 |
PollAnswer(
|
| 216 |
id=FileStream.rnd_id(),
|
| 217 |
question="Is this a poll question?",
|