This commit is contained in:
thedragonsinn
2023-09-26 10:24:18 +05:30
parent 59b6c8f127
commit 265e0be92c
4 changed files with 9 additions and 4 deletions

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@ config*.env
venv/
__pycache__
.idea/
conf_backup/

View File

@@ -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

View File

@@ -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)

View File

@@ -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")