This commit is contained in:
yasirarism 2023-07-04 12:23:38 +07:00 committed by GitHub
parent 503c0dd6c3
commit f6e1e5919c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -18,6 +18,7 @@
import contextlib
import os
import typing
import logging
import pyrogram
from datetime import datetime
from misskaty.vars import LOG_CHANNEL
@ -55,7 +56,7 @@ async def handle_error(
import traceback
import logging
logging = logger.getLogger(__name__)
logging = logging.getLogger(__name__)
logging.exception(traceback.format_exc())
day = datetime.now()

View file

@ -68,11 +68,11 @@ async def kbbi_search(_, ctx: Client):
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(res)
await ctx.reply(f"{res}\n\n<b>By YasirPedia API</b>)
@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:
return await ctx.reply("Please reply text to make carbon or add text after command.")
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"
with open(fname, 'wb') as e:
e.write(response.content)
await ctx.reply_photo(fname)
await ctx.reply_photo(fname, caption=f"Generated by @{self.me.username}")
os.remove(fname)