mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 17:44:50 +00:00
style: format code with black and isort (#168)
Format code with black and isort
This commit fixes the style issues introduced in bffcf61 according to the output
from Black and isort.
Details: https://app.deepsource.com/gh/yasirarism/MissKatyPyro/transform/4ddb51cc-a1ca-432a-95c4-1fb5388b405a/
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
This commit is contained in:
parent
bffcf61685
commit
0cd960bc1b
5 changed files with 34 additions and 20 deletions
|
|
@ -1,3 +1,3 @@
|
|||
# skipcq
|
||||
from .callback import callback
|
||||
from .command import command
|
||||
from .callback import callback
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
# skipcq
|
||||
from .utils import PyromodConfig, patch, patchable
|
||||
from .handler_error import handle_error
|
||||
from .admin_utils import check_rights, is_admin
|
||||
from .get_user import get_user
|
||||
from .get_user import get_user
|
||||
from .handler_error import handle_error
|
||||
from .utils import PyromodConfig, patch, patchable
|
||||
|
|
|
|||
|
|
@ -3,11 +3,12 @@
|
|||
# * @projectName MissKatyPyro
|
||||
# * Copyright ©YasirPedia All rights reserved
|
||||
import logging
|
||||
|
||||
from pyrogram.types import Message
|
||||
|
||||
from misskaty import app
|
||||
from misskaty.helper.http import http
|
||||
from misskaty.core.decorator.ratelimiter import ratelimiter
|
||||
from misskaty.helper.http import http
|
||||
from misskaty.vars import CURRENCY_API
|
||||
|
||||
__MODULE__ = "Currency"
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ from pyrogram.types import (
|
|||
Message,
|
||||
)
|
||||
|
||||
from database.imdb_db import is_imdbset, add_imdbset, remove_imdbset
|
||||
from database.imdb_db import add_imdbset, is_imdbset, remove_imdbset
|
||||
from misskaty import app
|
||||
from misskaty.core.decorator.ratelimiter import ratelimiter
|
||||
from misskaty.core.misskaty_patch.listen.listen import ListenerTimeout
|
||||
|
|
|
|||
|
|
@ -19,7 +19,12 @@ from gtts import gTTS
|
|||
from PIL import Image
|
||||
from pyrogram import Client, filters
|
||||
from pyrogram.errors import MessageTooLong, UserNotParticipant
|
||||
from pyrogram.types import CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup, Message
|
||||
from pyrogram.types import (
|
||||
CallbackQuery,
|
||||
InlineKeyboardButton,
|
||||
InlineKeyboardMarkup,
|
||||
Message,
|
||||
)
|
||||
|
||||
from misskaty import BOT_USERNAME, app
|
||||
from misskaty.core.decorator.errors import capture_err
|
||||
|
|
@ -64,14 +69,14 @@ async def kbbi_search(_, ctx: Client):
|
|||
if nomsg := r.get("detail"):
|
||||
return await ctx.reply_msg(nomsg)
|
||||
kbbi_btn = InlineKeyboardMarkup(
|
||||
[[InlineKeyboardButton(text="Open in Web", url=r.get('link'))]]
|
||||
)
|
||||
[[InlineKeyboardButton(text="Open in Web", url=r.get("link"))]]
|
||||
)
|
||||
res = "<b>Definisi:</b>\n"
|
||||
for num, a in enumerate(r.get("result"), start=1):
|
||||
submakna = "".join(f"{a}, " for a in a['makna'][0]['submakna'])[:-2]
|
||||
contoh = "".join(f"{a}, " for a in a['makna'][0]['contoh'])[:-2]
|
||||
kt_dasar = "".join(f"{a}, " for a in a['kata_dasar'])[:-2]
|
||||
bt_takbaku = "".join(f"{a}, " for a in a['bentuk_tidak_baku'])[:-2]
|
||||
submakna = "".join(f"{a}, " for a in a["makna"][0]["submakna"])[:-2]
|
||||
contoh = "".join(f"{a}, " for a in a["makna"][0]["contoh"])[:-2]
|
||||
kt_dasar = "".join(f"{a}, " for a in a["kata_dasar"])[:-2]
|
||||
bt_takbaku = "".join(f"{a}, " for a in a["bentuk_tidak_baku"])[:-2]
|
||||
res += f"<b>{a['nama']} ({a['makna'][0]['kelas'][0]['nama']}: {a['makna'][0]['kelas'][0]['deskripsi']})</b>\n<b>Kata Dasar:</b> {kt_dasar if kt_dasar else '-'}\n<b>Bentuk Tidak Baku:</b> {bt_takbaku if bt_takbaku else '-'}\n<b>Submakna:</b> {submakna}\n<b>Contoh:</b> {contoh if contoh else '-'}\n\n"
|
||||
await ctx.reply(f"{res}<b>By YasirPedia API</b>", reply_markup=kbbi_btn)
|
||||
|
||||
|
|
@ -79,9 +84,13 @@ async def kbbi_search(_, ctx: Client):
|
|||
@app.on_cmd("carbon")
|
||||
async def carbon_make(self: Client, ctx: Message):
|
||||
if len(ctx.command) == 1 and not ctx.reply_to_message:
|
||||
return await ctx.reply("Please reply text to make carbon or add text after command.")
|
||||
return await ctx.reply(
|
||||
"Please reply text to make carbon or add text after command."
|
||||
)
|
||||
if not ctx.reply_to_message:
|
||||
return await ctx.reply("Please reply text to make carbon or add text after command.")
|
||||
return await ctx.reply(
|
||||
"Please reply text to make carbon or add text after command."
|
||||
)
|
||||
if ctx.reply_to_message.text:
|
||||
text = ctx.reply_to_message.text
|
||||
elif ctx.reply_to_message.caption:
|
||||
|
|
@ -89,13 +98,17 @@ async def carbon_make(self: Client, ctx: Message):
|
|||
else:
|
||||
text = ctx.input
|
||||
json_data = {
|
||||
'code': text,
|
||||
'backgroundColor': '#1F816D',
|
||||
"code": text,
|
||||
"backgroundColor": "#1F816D",
|
||||
}
|
||||
|
||||
response = await http.post('https://carbon.yasirapi.eu.org/api/cook', json=json_data)
|
||||
fname = f"carbonBY_{ctx.from_user.id if ctx.from_user else ctx.sender_chat.title}.png"
|
||||
with open(fname, 'wb') as e:
|
||||
response = await http.post(
|
||||
"https://carbon.yasirapi.eu.org/api/cook", json=json_data
|
||||
)
|
||||
fname = (
|
||||
f"carbonBY_{ctx.from_user.id if ctx.from_user else ctx.sender_chat.title}.png"
|
||||
)
|
||||
with open(fname, "wb") as e:
|
||||
e.write(response.content)
|
||||
await ctx.reply_photo(fname, caption=f"Generated by @{self.me.username}")
|
||||
os.remove(fname)
|
||||
|
|
|
|||
Loading…
Reference in a new issue