fixes.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@ config*.env
|
||||
venv/
|
||||
__pycache__
|
||||
.idea/
|
||||
conf_backup/
|
||||
|
||||
@@ -87,7 +87,7 @@ class BOT(Client):
|
||||
parse_mode=ParseMode.HTML,
|
||||
) -> Message | Msg:
|
||||
if message:
|
||||
return await message.copy(chat_id=Config.LOG_CHAT)
|
||||
return (await message.copy(chat_id=Config.LOG_CHAT))
|
||||
if traceback:
|
||||
text = f"""
|
||||
#Traceback
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Awaitable
|
||||
from typing import Awaitable
|
||||
|
||||
from pyrogram.types import ChatPermissions, ChatPrivileges, User
|
||||
|
||||
@@ -50,11 +50,14 @@ async def promote_or_demote(bot: bot, message: Message) -> None:
|
||||
chat_id=message.chat.id, user_id=user.id, privileges=privileges
|
||||
)
|
||||
if not demote:
|
||||
# Let server promote admin before setting title
|
||||
# Bot is too fast moment 😂😂😂
|
||||
await asyncio.sleep(3)
|
||||
await bot.set_administrator_title(
|
||||
chat_id=message.chat.id, user_id=user.id, title=title or "Admin"
|
||||
)
|
||||
if title:
|
||||
response += f"\nTitle: {title}."
|
||||
response += f"\nTitle: {title}"
|
||||
await message.reply(text=response)
|
||||
except Exception as e:
|
||||
await message.reply(text=e, del_in=10, block=True)
|
||||
|
||||
@@ -55,9 +55,10 @@ async def join_chat(bot: bot, message: Message) -> None:
|
||||
except (KeyError, BadRequest):
|
||||
try:
|
||||
await bot.join_chat(os.path.basename(chat).strip())
|
||||
await message.reply("Joined")
|
||||
except Exception as e:
|
||||
await message.reply(str(e))
|
||||
return
|
||||
await message.reply("Joined")
|
||||
|
||||
|
||||
@bot.add_cmd(cmd="leave")
|
||||
|
||||
Reference in New Issue
Block a user