Owner Cmd auto DL.

This commit is contained in:
thedragonsinn
2023-10-05 13:17:22 +05:30
parent a2042b63cd
commit 0928021d66
3 changed files with 8 additions and 2 deletions

View File

@@ -14,7 +14,8 @@ async def cmd_dispatcher(bot, message) -> None:
func = Config.CMD_DICT[message.cmd]
coro = func(bot, message)
await run_coro(coro, message)
if message.is_from_owner:
await message.delete()
@bot.on_message(filters.convo_filter, group=0)
@bot.on_edited_message(filters.convo_filter, group=0)

View File

@@ -39,6 +39,12 @@ class Message(Msg):
return self.text.split(maxsplit=1)[-1]
return ""
@cached_property
def is_from_owner(self) -> bool:
if self.from_user and self.from_user.id == Config.OWNER_ID:
return True
return False
@cached_property
def replied(self) -> "Message":
if self.reply_to_message:

View File

@@ -66,7 +66,6 @@ async def remove_fed(bot: bot, message: Message):
@bot.add_cmd(cmd=["fban", "fbanp"])
async def fed_ban(bot: bot, message: Message):
await message.delete()
progress: Message = await message.reply("")
user, reason = await message.extract_user_n_reason()
if isinstance(user, str):