diff --git a/misskaty/__init__.py b/misskaty/__init__.py index acf1102b..caabbcac 100644 --- a/misskaty/__init__.py +++ b/misskaty/__init__.py @@ -48,9 +48,9 @@ scheduler = AsyncIOScheduler(jobstores=jobstores, timezone=TZ) app.start() user.start() -BOT_ID = app.id -BOT_NAME = app.first_name -BOT_USERNAME = app.username -UBOT_ID = user.id -UBOT_NAME = user.first_name -UBOT_USERNAME = user.username +BOT_ID = app.me.id +BOT_NAME = app.me.first_name +BOT_USERNAME = app.me.username +UBOT_ID = user.me.id +UBOT_NAME = user.me.first_name +UBOT_USERNAME = user.me.username diff --git a/misskaty/plugins/ocr.py b/misskaty/plugins/ocr.py index 44e6e960..8f164385 100644 --- a/misskaty/plugins/ocr.py +++ b/misskaty/plugins/ocr.py @@ -29,7 +29,7 @@ __HELP__ = f"/ocr [reply to photo] - Read Text From Image" @use_chat_lang() async def ocr(_, m, strings): reply = m.reply_to_message - if not reply or not reply.photo and not reply.sticker: + if not reply or not reply.photo and (reply.document and not reply.document.mime_type.startswith("image")) and not reply.sticker: return await kirimPesan(m, strings("no_photo").format(cmd=m.command[0]), quote=True) msg = await kirimPesan(m, strings("read_ocr"), quote=True) try: