remove plugins that i dont want

kate
udf 2019-09-09 09:41:27 +02:00
parent 080f18302c
commit 692cc6b9ac
Signed by: kate
GPG Key ID: E40724BAD73AF77B
3 changed files with 0 additions and 97 deletions

View File

@ -1,27 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import asyncio
from telethon import events
_last_messages = {}
@borg.on(events.NewMessage(outgoing=True))
async def _(event):
_last_messages[event.chat_id] = event.message
@borg.on(events.NewMessage(pattern=r"\.(fix)?reply", outgoing=True))
async def _(event):
if not event.is_reply or event.chat_id not in _last_messages:
return
message = _last_messages[event.chat_id]
chat = await event.get_input_chat()
await asyncio.wait([
borg.delete_messages(chat, [event.id, message.id]),
borg.send_message(chat, message, reply_to=event.reply_to_msg_id)
])

View File

@ -1,27 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import string
from telethon import events
from telethon.tl import types
msg_cache = {}
@borg.on(events.NewMessage(pattern=r"\.fpost\s+(.*)", outgoing=True))
async def _(event):
await event.delete()
text = event.pattern_match.group(1)
destination = await event.get_input_chat()
for c in text.lower():
if c not in string.ascii_lowercase:
continue
if c not in msg_cache:
async for msg in borg.iter_messages(None, search=c):
if msg.raw_text.lower() == c and msg.media is None:
msg_cache[c] = msg
break
await borg.forward_messages(destination, msg_cache[c])

View File

@ -1,43 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import random
from telethon import events, types, functions, utils
def choser(cmd, pack, blacklist={}):
docs = None
@borg.on(events.NewMessage(pattern=rf'\.{cmd}', outgoing=True))
async def handler(event):
await event.delete()
nonlocal docs
if docs is None:
docs = [
utils.get_input_document(x)
for x in (await borg(functions.messages.GetStickerSetRequest(types.InputStickerSetShortName(pack)))).documents
if x.id not in blacklist
]
await event.respond(file=random.choice(docs))
choser('brain', 'supermind')
choser('dab', 'DabOnHaters', {
1653974154589768377,
1653974154589768312,
1653974154589767857,
1653974154589768311,
1653974154589767816,
1653974154589767939,
1653974154589767944,
1653974154589767912,
1653974154589767911,
1653974154589767910,
1653974154589767909,
1653974154589767863,
1653974154589767852,
1653974154589768677
})