Skip to content

Commit

Permalink
pylint: auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
buddhhu committed May 16, 2024
1 parent aff7fdb commit a748bf1
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions plugins/quizgame.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
from core.decorators._assistant import asst_cmd, callback
from telethon import TelegramClient
from telethon.errors import ChatSendStickersForbiddenError
from telethon.events import Raw, NewMessage, CallbackQuery
from telethon.events import CallbackQuery, Raw
from telethon.tl.functions.messages import SendMediaRequest
from telethon.tl.types import InputMediaPoll, Poll, PollAnswer, UpdateMessagePollVote
from telethon.tl.types import (InputMediaPoll, Poll, PollAnswer,
UpdateMessagePollVote)

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

Expand Down Expand Up @@ -85,12 +86,14 @@ async def choose_cata(event: CallbackQuery.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 @@ -120,7 +123,9 @@ async def choose_cata(event: CallbackQuery.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 @@ -143,7 +148,8 @@ async def choose_cata(event: CallbackQuery.Event):
client: TelegramClient = event.client
input_chat = await event.get_input_chat()
m_ = client._get_response_message(None, m_, input_chat)
POLLS.update({m_.poll.poll.id: {"chat": m_.chat_id, "answer": ansi}})
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 a748bf1

Please sign in to comment.