mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-07 12:24:51 +00:00
Fix
This commit is contained in:
parent
3244b98ed9
commit
e53ae30a32
2 changed files with 19 additions and 24 deletions
|
|
@ -8,6 +8,7 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
import importlib
|
import importlib
|
||||||
import re
|
import re
|
||||||
|
import traceback
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
from pyrogram import __version__, filters, idle
|
from pyrogram import __version__, filters, idle
|
||||||
|
|
@ -41,7 +42,7 @@ async def start_bot():
|
||||||
if hasattr(imported_module, "__MODULE__") and imported_module.__MODULE__:
|
if hasattr(imported_module, "__MODULE__") and imported_module.__MODULE__:
|
||||||
imported_module.__MODULE__ = imported_module.__MODULE__
|
imported_module.__MODULE__ = imported_module.__MODULE__
|
||||||
if hasattr(imported_module, "__HELP__") and imported_module.__HELP__:
|
if hasattr(imported_module, "__HELP__") and imported_module.__HELP__:
|
||||||
HELPABLE[str(imported_module.__MODULE__).lower()] = imported_module
|
HELPABLE[imported_module.__MODULE__.lower()] = imported_module
|
||||||
bot_modules = ""
|
bot_modules = ""
|
||||||
j = 1
|
j = 1
|
||||||
for i in ALL_MODULES:
|
for i in ALL_MODULES:
|
||||||
|
|
@ -358,8 +359,9 @@ if __name__ == "__main__":
|
||||||
loop.run_until_complete(start_bot())
|
loop.run_until_complete(start_bot())
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
pass
|
||||||
except Exception as err:
|
except Exception:
|
||||||
LOGGER.error(err.with_traceback(None))
|
err = traceback.format_exc()
|
||||||
|
LOGGER.error(err)
|
||||||
finally:
|
finally:
|
||||||
loop.run_until_complete(cleanup())
|
loop.run_until_complete(cleanup())
|
||||||
loop.stop()
|
loop.stop()
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,20 @@
|
||||||
from misskaty import app
|
|
||||||
from logging import getLogger
|
|
||||||
import traceback
|
import traceback
|
||||||
from misskaty.vars import COMMAND_HANDLER, API_HASH, API_ID
|
from logging import getLogger
|
||||||
from pyrogram import filters, Client
|
|
||||||
|
from pyrogram import Client, filters
|
||||||
|
from pyrogram.errors import (ApiIdInvalid, PasswordHashInvalid,
|
||||||
|
PhoneCodeExpired, PhoneCodeInvalid,
|
||||||
|
PhoneNumberInvalid, SessionPasswordNeeded)
|
||||||
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
|
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
|
||||||
from telethon import TelegramClient
|
from telethon import TelegramClient
|
||||||
|
from telethon.errors import (ApiIdInvalidError, PasswordHashInvalidError,
|
||||||
|
PhoneCodeExpiredError, PhoneCodeInvalidError,
|
||||||
|
PhoneNumberInvalidError,
|
||||||
|
SessionPasswordNeededError)
|
||||||
from telethon.sessions import StringSession
|
from telethon.sessions import StringSession
|
||||||
from pyrogram.errors import (
|
|
||||||
ApiIdInvalid,
|
from misskaty import app
|
||||||
PhoneNumberInvalid,
|
from misskaty.vars import API_HASH, API_ID, COMMAND_HANDLER
|
||||||
PhoneCodeInvalid,
|
|
||||||
PhoneCodeExpired,
|
|
||||||
SessionPasswordNeeded,
|
|
||||||
PasswordHashInvalid
|
|
||||||
)
|
|
||||||
from telethon.errors import (
|
|
||||||
ApiIdInvalidError,
|
|
||||||
PhoneNumberInvalidError,
|
|
||||||
PhoneCodeInvalidError,
|
|
||||||
PhoneCodeExpiredError,
|
|
||||||
SessionPasswordNeededError,
|
|
||||||
PasswordHashInvalidError
|
|
||||||
)
|
|
||||||
|
|
||||||
LOGGER = getLogger(__name__)
|
LOGGER = getLogger(__name__)
|
||||||
|
|
||||||
|
|
@ -200,7 +193,7 @@ async def generate_session(bot, msg, telethon=False, is_bot: bool = False):
|
||||||
string_session = client.session.save()
|
string_session = client.session.save()
|
||||||
else:
|
else:
|
||||||
string_session = await client.export_session_string()
|
string_session = await client.export_session_string()
|
||||||
text = f"**This is your {ty} String Session** \n\n`{string_session}` \n\n**Generated By :** @{client.me.username}\n🍒 **Note :** Don't share it to anyone. And don't forget to support this owner bot if you like"
|
text = f"**This is your {ty} String Session** \n\n`{string_session}` \n\n**Generated By :** @{client.me.username}\n🍒 **Note :** Don't share it to anyone And don't forget to support this owner bot if you like🥺"
|
||||||
try:
|
try:
|
||||||
if not is_bot:
|
if not is_bot:
|
||||||
await client.send_message("me", text)
|
await client.send_message("me", text)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue