Skip to content

Commit

Permalink
Update quizgame.py
Browse files Browse the repository at this point in the history
  • Loading branch information
New-dev0 authored May 16, 2024
1 parent d5e8bfd commit ad01b50
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions plugins/quizgame.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from core.decorators._assistant import asst_cmd, callback
from telethon.errors import ChatSendStickersForbiddenError
from telethon.events import Raw
from telethon.tl.types import (InputMediaPoll, Poll, PollAnswer,
UpdateMessagePollVote)
from telethon.tl.functions.messages import SendMediaRequest
from telethon.tl.types import InputMediaPoll, Poll, PollAnswer, UpdateMessagePollVote

from .. import Button, asst, async_searcher, get_string, inline_mention

Expand Down Expand Up @@ -84,14 +84,12 @@ async def choose_cata(event):
text = get_string("games_3")
elif match[0] == "c":
m = match[1:]
buttons = [
[Button.inline(str(i), f"trziat{m}_{i}") for i in range(10, 70, 20)]]
buttons = [[Button.inline(str(i), f"trziat{m}_{i}") for i in range(10, 70, 20)]]
text = get_string("games_4")
elif match[0] == "t":
m_ = match[1:]
buttons = [
[Button.inline(str(i), f"trzias{m_}_{i}")
for i in [10, 30, 60, 120]]
[Button.inline(str(i), f"trzias{m_}_{i}") for i in [10, 30, 60, 120]]
]
text = get_string("games_5")
elif match[0] == "s":
Expand Down Expand Up @@ -121,9 +119,7 @@ async def choose_cata(event):
opts = [PollAnswer(unescape(q["correct_answer"]), ansi)]
[
opts.append(
PollAnswer(
unescape(a), str(
uuid.uuid1()).split("-")[0].encode())
PollAnswer(unescape(a), str(uuid.uuid1()).split("-")[0].encode())
)
for a in q["incorrect_answers"]
]
Expand All @@ -141,9 +137,8 @@ async def choose_cata(event):
solution="Join @TeamUltroid",
solution_entities=[],
)
m_ = await event.client.send_file(chat, file=poll)
POLLS.update(
{m_.poll.poll.id: {"chat": m_.chat_id, "answer": ansi}})
m_ = await event.client(SendMediaRequest(chat, media=poll))
POLLS.update({m_.poll.poll.id: {"chat": m_.chat_id, "answer": ansi}})
await asyncio.sleep(int(in_))
if not TRIVIA_CHATS[chat]:
await event.respond(
Expand Down

0 comments on commit ad01b50

Please sign in to comment.