BinaryONe
commited on
Commit
·
a085062
1
Parent(s):
76f976a
Polls Update
Browse files
FileStream/bot/plugins/FileHandlers/polls.py
CHANGED
|
@@ -9,15 +9,18 @@ from FileStream.utils.FileProcessors.bot_utils import is_user_banned, is_user_ex
|
|
| 9 |
async def get_result(FileStream , message):
|
| 10 |
#result = await FileStream.get_messages(chat_id , poll.id)
|
| 11 |
print(message)
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
| 15 |
instruction = {
|
| 16 |
"privacy_type":"PUBLIC",
|
| 17 |
"user_id":message.from_user.id if (message.chat.type == ChatType.PRIVATE) else message.chat.id,
|
| 18 |
"user_type": "TELEGRAM"
|
| 19 |
}
|
| 20 |
-
main_msg= await FileStream.get_messages(
|
| 21 |
#reply = await message.reply_text(LANG.PROCESSING_TEXT)
|
| 22 |
reply_markup, stream_text = await upload_type_func(file_info=get_file_info(main_msg, instruction),replied_message=result.id)
|
| 23 |
await update.message.edit_text(
|
|
|
|
| 9 |
async def get_result(FileStream , message):
|
| 10 |
#result = await FileStream.get_messages(chat_id , poll.id)
|
| 11 |
print(message)
|
| 12 |
+
question_parts = message.poll.question.split('_')
|
| 13 |
+
msg_id = question_parts[0]
|
| 14 |
+
user_id = question_parts[1]
|
| 15 |
+
options_list = [option['text'] for option in message.poll.options if option['voter_count'] == 1]
|
| 16 |
+
print(options_list)
|
| 17 |
+
await FileStream.stop_poll(user_id, message.id)
|
| 18 |
instruction = {
|
| 19 |
"privacy_type":"PUBLIC",
|
| 20 |
"user_id":message.from_user.id if (message.chat.type == ChatType.PRIVATE) else message.chat.id,
|
| 21 |
"user_type": "TELEGRAM"
|
| 22 |
}
|
| 23 |
+
main_msg= await FileStream.get_messages(user_id, msg_id)
|
| 24 |
#reply = await message.reply_text(LANG.PROCESSING_TEXT)
|
| 25 |
reply_markup, stream_text = await upload_type_func(file_info=get_file_info(main_msg, instruction),replied_message=result.id)
|
| 26 |
await update.message.edit_text(
|