diff --git a/misskaty/core/misskaty_patch/utils/handler_error.py b/misskaty/core/misskaty_patch/utils/handler_error.py index d75882f5..fd9d0d5f 100644 --- a/misskaty/core/misskaty_patch/utils/handler_error.py +++ b/misskaty/core/misskaty_patch/utils/handler_error.py @@ -72,7 +72,7 @@ async def handle_error( "An Internal Error Occurred while Processing your Command, the Logs have been sent to the Owners of this Bot. Sorry for Inconvenience" ) await m._client.send_document( - LOG_CHANNEL, f"crash_{tgl_now.strftime('%d %B %Y')}.txt", caption="Crash Report of this Bot\n{cap_day}" + LOG_CHANNEL, f"crash_{tgl_now.strftime('%d %B %Y')}.txt", caption=f"Crash Report of this Bot\n{cap_day}" ) if isinstance(m, pyrogram.types.CallbackQuery): with contextlib.suppress(Exception): @@ -81,7 +81,7 @@ async def handle_error( "An Internal Error Occurred while Processing your Command, the Logs have been sent to the Owners of this Bot. Sorry for Inconvenience" ) await m.message._client.send_document( - LOG_CHANNEL, f"crash_{tgl_now.strftime('%d %B %Y')}.txt", caption="Crash Report of this Bot\n{cap_day}" + LOG_CHANNEL, f"crash_{tgl_now.strftime('%d %B %Y')}.txt", caption=f"Crash Report of this Bot\n{cap_day}" ) os.remove(f"crash_{tgl_now.strftime('%d %B %Y')}.txt") return True \ No newline at end of file diff --git a/misskaty/plugins/misc_tools.py b/misskaty/plugins/misc_tools.py index 32109203..76fb9c9d 100644 --- a/misskaty/plugins/misc_tools.py +++ b/misskaty/plugins/misc_tools.py @@ -61,19 +61,22 @@ async def kbbi_search(_, ctx: Client): if len(ctx.command) == 1: return await ctx.reply_msg("Please add keyword to search definition in kbbi") r = (await http.get(f"https://yasirapi.eu.org/kbbi?kata={ctx.input}")).json() - res = f"Link: {r.get('link')}\nDefinisi:\n" + kbbi_btn = InlineKeyboardMarkup( + [[InlineKeyboardButton(text="Open in Web", url=r.get('link'))]] + ) + res = f"Definisi:\n" for a in r.get("result"): 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"{a['nama']} ({a['makna'][0]['kelas'][0]['nama']}: {a['makna'][0]['kelas'][0]['deskripsi']})\nKata Dasar: {kt_dasar if kt_dasar else '-'}\nBentuk Tidak Baku: {bt_takbaku if bt_takbaku else '-'}\nSubmakna: {submakna}\nContoh: {contoh if contoh else '-'}\n\n" - await ctx.reply(f"{res}By YasirPedia API") + await ctx.reply(f"{res}By YasirPedia API", reply_markup=kbbi_btn) @app.on_cmd("carbon") 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 ctx.reply_to_message: return await ctx.reply("Please reply text to make carbon or add text after command.") if not reply_to_message: return await ctx.reply("Please reply text to make carbon or add text after command.")