mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-07 12:24:51 +00:00
lupa
This commit is contained in:
parent
503c0dd6c3
commit
f6e1e5919c
2 changed files with 5 additions and 4 deletions
|
|
@ -18,6 +18,7 @@
|
||||||
import contextlib
|
import contextlib
|
||||||
import os
|
import os
|
||||||
import typing
|
import typing
|
||||||
|
import logging
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from misskaty.vars import LOG_CHANNEL
|
from misskaty.vars import LOG_CHANNEL
|
||||||
|
|
@ -55,7 +56,7 @@ async def handle_error(
|
||||||
import traceback
|
import traceback
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
logging = logger.getLogger(__name__)
|
logging = logging.getLogger(__name__)
|
||||||
logging.exception(traceback.format_exc())
|
logging.exception(traceback.format_exc())
|
||||||
|
|
||||||
day = datetime.now()
|
day = datetime.now()
|
||||||
|
|
|
||||||
|
|
@ -68,11 +68,11 @@ async def kbbi_search(_, ctx: Client):
|
||||||
kt_dasar = "".join(f"{a}, " for a in a['kata_dasar'])[:-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]
|
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"
|
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(res)
|
await ctx.reply(f"{res}\n\n<b>By YasirPedia API</b>)
|
||||||
|
|
||||||
|
|
||||||
@app.on_cmd("carbon")
|
@app.on_cmd("carbon")
|
||||||
async def carbon_make(_, ctx: Client):
|
async def carbon_make(self: Client, ctx: Message):
|
||||||
if len(ctx.command) == 1 and not reply_to_message:
|
if len(ctx.command) == 1 and not 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 reply_to_message:
|
if not reply_to_message:
|
||||||
|
|
@ -92,7 +92,7 @@ async def carbon_make(_, ctx: Client):
|
||||||
fname = f"carbonBY_{ctx.from_user.id if ctx.from_user else ctx.sender_chat.title}.png"
|
fname = f"carbonBY_{ctx.from_user.id if ctx.from_user else ctx.sender_chat.title}.png"
|
||||||
with open(fname, 'wb') as e:
|
with open(fname, 'wb') as e:
|
||||||
e.write(response.content)
|
e.write(response.content)
|
||||||
await ctx.reply_photo(fname)
|
await ctx.reply_photo(fname, caption=f"Generated by @{self.me.username}")
|
||||||
os.remove(fname)
|
os.remove(fname)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue