Temporary double trigger fix.

This commit is contained in:
thedragonsinn
2023-10-03 20:46:51 +05:30
parent 80f3c19cab
commit 467b41eede
2 changed files with 4 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ from pyrogram import filters as _filters
from app import Config
recent_texts=[]
def dynamic_cmd_filter(_, __, message) -> bool:
if (
@@ -9,9 +10,10 @@ def dynamic_cmd_filter(_, __, message) -> bool:
or not message.text.startswith(Config.TRIGGER)
or not message.from_user
or message.from_user.id not in Config.USERS
or message.id in recent_texts
):
return False
recent_texts.append(message.id)
start_str = message.text.split(maxsplit=1)[0]
cmd = start_str.replace(Config.TRIGGER, "", 1)
cmd_check = cmd in Config.CMD_DICT

View File

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