Spaces:
Running
Running
File size: 1,964 Bytes
8be86b5 c96bd11 8be86b5 c96bd11 57fd0fb 3eea08e 51a8114 0505cab 51a8114 3eea08e 7be9571 26f26bd 29ee534 26f26bd 8a4a5fa 26f26bd 8be86b5 26f26bd c96bd11 3eea08e ac47e66 eb22c28 a7ff8c9 3eea08e c96bd11 a7ff8c9 4f1c0a3 a7ff8c9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
from pyrogram import filters, Client
from FileStream.bot import FileStream
from FileStream.utils.FileProcessors.file_properties import get_file_ids, get_file_info, get_private_file_ids
from FileStream.utils.FileProcessors.bot_utils import is_user_banned, is_user_exist, is_user_joined, gen_link, is_channel_banned, is_channel_exist, is_user_authorized, upload_type_func
#@FileStream.on_message(filters.command("result"))
@FileStream.on_poll()
async def get_result(FileStream , message):
#result = await FileStream.get_messages(chat_id , poll.id)
print(message)
result=message
print(result.poll.chosen_option)
#await FileStream.stop_poll(chat_id, message_id)
instruction = {
"privacy_type":"PUBLIC",
"user_id":message.from_user.id if (message.chat.type == ChatType.PRIVATE) else message.chat.id,
"user_type": "TELEGRAM"
}
main_msg= await FileStream.get_messages(instruction['user_id'], result.poll.explanation)
#reply = await message.reply_text(LANG.PROCESSING_TEXT)
reply_markup, stream_text = await upload_type_func(file_info=get_file_info(main_msg, instruction),replied_message=result.id)
await update.message.edit_text(
text=stream_text,
parse_mode=ParseMode.HTML,
disable_web_page_preview=True,
reply_markup=reply_markup,
)
"""
@FileStream.on_poll()
def handle_poll(FileStream, poll):
print(f"Poll ID: {poll.id}")
print(f"Question: {poll.question}")
print(f"Options: {poll.options}")
print(f"Options: {poll.answers}")
print(f"Total Voters: {poll.total_voter_count}")
@FileStream.on_poll()
def handle_poll(FileStream, poll, poll_answer):
user_id = poll_answer.user.id
poll_id = poll_answer.poll_id
option_ids = poll_answer.option_ids
print(f"User {user_id} voted in poll {poll_id} for options {option_ids}")
app.loop.create_task(poll_handler(client, poll))
""" |