Compare commits
2 Commits
3fc088c938
...
fa54d641cc
Author | SHA1 | Date |
---|---|---|
|
fa54d641cc | |
|
3d96fe5f89 |
|
@ -20,3 +20,4 @@ config:
|
||||||
log_reports: true
|
log_reports: true
|
||||||
log_forwards: true
|
log_forwards: true
|
||||||
log_ring_maxlen: 69420
|
log_ring_maxlen: 69420
|
||||||
|
auto_clear_reactions: false
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
import asyncio
|
||||||
|
from pyrogram import Client, filters
|
||||||
|
from pyrogram.raw.functions.messages import ReadReactions
|
||||||
|
from .. import config, log_errors
|
||||||
|
|
||||||
|
# I fucking HATE reactions!
|
||||||
|
@Client.on_message(filters.outgoing & filters.edited)
|
||||||
|
@log_errors
|
||||||
|
async def auto_clear_reactions(client, message):
|
||||||
|
if not config['config'].get('auto_clear_reactions') or not message.reactions:
|
||||||
|
return
|
||||||
|
while True:
|
||||||
|
if (await client.send(ReadReactions(peer=await client.resolve_peer(message.chat.id)))).pts_count > 0:
|
||||||
|
break
|
||||||
|
await asyncio.sleep(1)
|
|
@ -16,10 +16,7 @@ PYEXEC_REGEX = '^(?:' + '|'.join(map(re.escape, config['config']['prefixes'])) +
|
||||||
@log_errors
|
@log_errors
|
||||||
@public_log_errors
|
@public_log_errors
|
||||||
async def pyexec(client, message):
|
async def pyexec(client, message):
|
||||||
match = re.match(PYEXEC_REGEX, (message.text or message.caption).markdown)
|
code = message.matches[0].group(1).strip()
|
||||||
if not match:
|
|
||||||
return
|
|
||||||
code = match.group(1).strip()
|
|
||||||
class UniqueExecReturnIdentifier:
|
class UniqueExecReturnIdentifier:
|
||||||
pass
|
pass
|
||||||
tree = ast.parse(code)
|
tree = ast.parse(code)
|
||||||
|
|
Loading…
Reference in New Issue