Don't handle scheduled messages

This commit is contained in:
blank X 2021-09-28 22:25:54 +07:00
parent c933266bbe
commit 4d2b2c65eb
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
21 changed files with 30 additions and 30 deletions

View File

@ -30,7 +30,7 @@ def _generate_sexy(entity, ping, is_creator):
sexy_text += ' <code>[CREATOR]</code>'
return sexy_text
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['admin', 'admins'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['admin', 'admins'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def admins(client, message):

View File

@ -5,7 +5,7 @@ from pyrogram.errors.exceptions.forbidden_403 import Forbidden
from pyrogram.errors.exceptions.bad_request_400 import ChatSendInlineForbidden
from .. import slave, config, help_dict, log_errors, public_log_errors
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['anilist', 'al', 'alc', 'alchar', 'alcharacter', 'anilistc', 'anilistchar', 'anilistcharacter'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['anilist', 'al', 'alc', 'alchar', 'alcharacter', 'anilistc', 'anilistchar', 'anilistcharacter'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def anilist(client, message):

View File

@ -4,7 +4,7 @@ import tempfile
from pyrogram import Client, filters
from .. import config, help_dict, log_errors, session, progress_callback, public_log_errors
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command('cat', prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command('cat', prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def cat(client, message):

View File

@ -3,7 +3,7 @@ import asyncio
from pyrogram import Client, filters
from .. import config, help_dict, log_errors, public_log_errors
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['d', 'del', 'delete'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['d', 'del', 'delete'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def delete(client, message):
@ -18,7 +18,7 @@ async def delete(client, message):
break
await client.delete_messages(message.chat.id, messages)
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['da', 'deleteall'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['da', 'deleteall'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def deleteall(client, message):
@ -28,7 +28,7 @@ async def deleteall(client, message):
return
await client.delete_user_history(message.chat.id, reply.from_user.id)
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['p', 'purge', 'sp', 'selfpurge'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['p', 'purge', 'sp', 'selfpurge'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def purge(client, message):
@ -61,7 +61,7 @@ async def purge(client, message):
yeetpurge_info = {True: dict(), False: dict()}
yeetpurge_lock = asyncio.Lock()
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['yp', 'yeetpurge', 'syp', 'selfyeetpurge'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['yp', 'yeetpurge', 'syp', 'selfyeetpurge'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def yeetpurge(client, message):

View File

@ -50,7 +50,7 @@ DEAI_MODULE_CODES = {
"8": "Codename Gestapo"
}
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['einfo', 'externalinfo', 'sw', 'spamwatch', 'deai', 'spb', 'spamprotection', 'cas', 'combot', 'rose'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['einfo', 'externalinfo', 'sw', 'spamwatch', 'deai', 'spb', 'spamprotection', 'cas', 'combot', 'rose'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def fedstat(client, message):
@ -200,7 +200,7 @@ async def get_spam_protection(entity):
return text
return f'- <b>{json["response_code"]}</b>: {json["error"]["error_code"]}: {json["error"]["type"]}: {html.escape(json["error"]["message"])}'
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.chat(['rsophiebot', 'missrose_bot']) & filters.incoming & filters.regex('^Federation ban info:\n|You aren\'t fbanned in this fed\.|^Failed to get user: unable to getChatMember: Bad Request: chat not found$|^(?:.+ )?is not banned in this fed\.$|^(?:.+ )?is currently banned in Rose Support Official, for the following reason:\n\n|^Looks like I don\'t have control over that user, or the ID isn\'t a valid one\. If you reply to one of their messages, I\'ll be able to interact with them\.$'))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.chat(['rsophiebot', 'missrose_bot']) & filters.incoming & filters.regex('^Federation ban info:\n|You aren\'t fbanned in this fed\.|^Failed to get user: unable to getChatMember: Bad Request: chat not found$|^(?:.+ )?is not banned in this fed\.$|^(?:.+ )?is currently banned in Rose Support Official, for the following reason:\n\n|^Looks like I don\'t have control over that user, or the ID isn\'t a valid one\. If you reply to one of their messages, I\'ll be able to interact with them\.$'))
async def fedstat_conversation_hack(client, message):
reply = message.reply_to_message
if not getattr(reply, 'empty', True):

View File

@ -4,7 +4,7 @@ from pyrogram import Client, filters
from pyrogram.errors.exceptions.bad_request_400 import MessageIdInvalid
from .. import config, help_dict, log_errors, session, progress_callback, public_log_errors
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['ls', 'hls', 'hiddenls'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['ls', 'hls', 'hiddenls'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def ls(client, message):
@ -28,7 +28,7 @@ async def ls(client, message):
text += f'<code>{html.escape(i)}</code>\n'
await message.reply_text(text or 'Empty', disable_web_page_preview=True)
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['ul', 'upload'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['ul', 'upload'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def upload(client, message):
@ -44,7 +44,7 @@ async def upload(client, message):
else:
await reply.delete()
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['dl', 'download'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['dl', 'download'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def download(client, message):

View File

@ -4,7 +4,7 @@ from pyrogram.errors.exceptions.forbidden_403 import Forbidden
from pyrogram.errors.exceptions.bad_request_400 import ChatSendInlineForbidden
from .. import slave, config, help_dict, log_errors, public_log_errors
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command('help', prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command('help', prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def help(client, message):

View File

@ -29,7 +29,7 @@ def _generate_sexy(entity, ping):
sexy_text += ' <code>[FAKE]</code>'
return sexy_text
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['info', 'whois'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['info', 'whois'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def info(client, message):
@ -77,7 +77,7 @@ async def info(client, message):
except MessageNotModified:
pass
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command('id', prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command('id', prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def id(client, message):

View File

@ -8,7 +8,7 @@ logged = defaultdict(set)
lock = asyncio.Lock()
force_ltr = '\u200E'
@Client.on_message(~filters.chat(config['config']['log_chat']) & filters.incoming & filters.forwarded & (filters.group | filters.channel))
@Client.on_message(~filters.scheduled & ~filters.chat(config['config']['log_chat']) & filters.incoming & filters.forwarded & (filters.group | filters.channel))
@log_errors
async def log_forwards(client, message):
if not config['config'].get('log_forwards'):

View File

@ -8,7 +8,7 @@ reported = defaultdict(set)
lock = asyncio.Lock()
force_ltr = '\u200E'
@Client.on_message(~filters.chat(config['config']['log_chat']) & filters.regex(r'(?:^|\s+)@admins?(?:$|\W+)|^[/!#](?:report|admins?)(?:$|\W+)') & filters.group)
@Client.on_message(~filters.scheduled & ~filters.chat(config['config']['log_chat']) & filters.regex(r'(?:^|\s+)@admins?(?:$|\W+)|^[/!#](?:report|admins?)(?:$|\W+)') & filters.group)
@log_errors
async def log_reports(client, message):
if not config['config']['log_reports']:

View File

@ -3,7 +3,7 @@ from pyrogram.types.messages_and_media import Photo
from pyrogram.errors.exceptions.forbidden_403 import Forbidden
from .. import slave, config, help_dict, log_errors, public_log_errors
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['loli', 'sfwloli', 'sloli', 'nsfwloli', 'nloli'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['loli', 'sfwloli', 'sloli', 'nsfwloli', 'nloli'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def loli(client, message):

View File

@ -10,7 +10,7 @@ from .. import config, help_dict, log_errors, session, slave, public_log_errors
help_text = ''
def _generate(i):
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(i, prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(i, prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def func(client, message):

View File

@ -7,7 +7,7 @@ strings = {
'pong': 'Ping!'
}
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['ping', 'pong'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['ping', 'pong'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def ping_pong(client, message):

View File

@ -3,7 +3,7 @@ import signal
from pyrogram import Client, filters
from .. import config, help_dict, log_errors, public_log_errors
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['poweroff', 'shutdown', 'stop'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['poweroff', 'shutdown', 'stop'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def poweroff(client, message):

View File

@ -12,7 +12,7 @@ from .. import config, help_dict, log_errors, slave, apps, session, public_log_e
exec_tasks = dict()
PYEXEC_REGEX = '^(?:' + '|'.join(map(re.escape, config['config']['prefixes'])) + r')exec\s+([\s\S]+)$'
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.regex(PYEXEC_REGEX))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.regex(PYEXEC_REGEX))
@log_errors
@public_log_errors
async def pyexec(client, message):
@ -91,7 +91,7 @@ async def pyexec(client, message):
else:
await reply.edit_text(output)
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['listexecs', 'listexec', 'lexec'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['listexecs', 'listexec', 'lexec'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def listexec(client, message):
@ -104,7 +104,7 @@ async def listexec(client, message):
text = '\n'.join(map(lambda i: f'<code>{i}</code>', exec_tasks))
await message.reply_text(text or 'No tasks')
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['cancelexec', 'cexec'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['cancelexec', 'cexec'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def cancelexec(client, message):

View File

@ -23,7 +23,7 @@ async def download_file(url, filename, referer=None):
return True
file.write(chunk)
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['saucenao', 'sauce'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['saucenao', 'sauce'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def saucenao(client, message):

View File

@ -6,7 +6,7 @@ from pyrogram import Client, filters
from .. import config, help_dict, log_errors, public_log_errors
SHELL_REGEX = '^(?:' + '|'.join(map(re.escape, config['config']['prefixes'])) + r')(?:(?:ba)?sh|shell|term(?:inal)?)\s+(.+)(?:\n([\s\S]+))?$'
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.regex(SHELL_REGEX))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.regex(SHELL_REGEX))
@log_errors
@public_log_errors
async def shell(client, message):

View File

@ -7,7 +7,7 @@ from .. import config, help_dict, log_errors, public_log_errors
PROBLEM_CODES = set(i for i in googletrans.LANGUAGES if '-' in i)
ZWS = '\u200B'
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['tr', 'translate'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['tr', 'translate'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def translate(client, message):

View File

@ -3,7 +3,7 @@ from pyrogram.errors.exceptions.forbidden_403 import Forbidden
from pyrogram.errors.exceptions.bad_request_400 import ChatSendInlineForbidden
from .. import slave, config, help_dict, log_errors, public_log_errors
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['ud', 'urbandictionary'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['ud', 'urbandictionary'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def ud(client, message):

View File

@ -10,7 +10,7 @@ from pyrogram import Client, filters
from pyrogram.types import Sticker
from .. import config, help_dict, log_errors, session, progress_callback, public_log_errors
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['trace', 'tracemoe', 'whatanime', 'wa', 'wait'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['trace', 'tracemoe', 'whatanime', 'wa', 'wait'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def whatanime(client, message):

View File

@ -3,7 +3,7 @@ from pyrogram.errors.exceptions.forbidden_403 import Forbidden
from pyrogram.errors.exceptions.bad_request_400 import ChatSendInlineForbidden
from .. import slave, config, help_dict, log_errors, public_log_errors
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['w', 'wiki', 'wikipedia'], prefixes=config['config']['prefixes']))
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['w', 'wiki', 'wikipedia'], prefixes=config['config']['prefixes']))
@log_errors
@public_log_errors
async def wikipedia(client, message):