This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# by @arthurwayne, I guess... | |
from datetime import datetime, date | |
import time | |
import os | |
import nltk | |
from nltk.corpus import stopwords | |
nltk.download("stopwords") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging, traceback, sys, io, os, html, textwrap, asyncio, inspect, random, re, time, subprocess, glob | |
from datetime import datetime | |
from asyncio import sleep | |
from contextlib import redirect_stdout | |
from io import StringIO | |
from utils import * | |
from telethon import TelegramClient, events, utils |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio, time, os, shutil | |
try: | |
import PIL, pySmartDL | |
except: | |
os.system("python3 -m pip install Pillow pySmartDL") | |
from datetime import datetime | |
from PIL import Image, ImageDraw, ImageFont | |
from pySmartDL import SmartDL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import telethon | |
from telethon.errors.rpcerrorlist import FloodWaitError | |
import asyncio | |
e = event | |
bot = c = cl = app = client | |
csm = client.send_message | |
ecid = event.chat_id | |
members = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging, traceback, sys, html, textwrap, asyncio | |
from io import StringIO | |
from telethon.events import NewMessage, MessageEdited | |
from telethon.errors.rpcerrorlist import MessageTooLongError | |
@client.on(events.NewMessage(outgoing=True, pattern=r"(\,x\s).+")) | |
@client.on(events.MessageEdited(outgoing=True, pattern=r"(\,x\s).+")) | |
async def eval(event): | |
client = event.client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group = 'telethonchat' | |
print( | |
( | |
( | |
lambda c: ( | |
lambda ts: "\n".join( | |
f"{t} messages from {u}" for t, u in sorted(ts, key=lambda t: -t[0]) | |
) | |
)( | |
( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io, asyncio | |
from asyncio import sleep | |
from telethon import TelegramClient, events | |
from telethon.events import NewMessage, MessageEdited | |
client = TelegramClient("session", 4, "014b35b6184100b085b0d0572f9b5103") | |
@client.on(events.ChatAction(func=lambda e: e.chat.id == 1234567890)) | |
async def welcome(event): | |
if event.user_joined or event.user_added: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aioschedule as schedule | |
import asyncio | |
from telethon import TelegramClient | |
with TelegramClient( | |
os.path.abspath(fileName), | |
config.getint("api", "api_id"), | |
config.get("api", "api_hash"), | |
connection_retries=15, | |
retry_delay=3, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyrogram import Filters, Message, Client | |
class custom(dict): | |
def __missing__(self, key): | |
return 0 | |
COMMAND = "wcount" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# c = Filters.create(lambda _, cbq: bool(re.match(r"^data_", cbq.callback_data))) | |
# Filters.regex('off-?topic') | |
# @client.on(NewMessage(..., pattern=r'(kek)')) | |
# def handler(event): | |
# event.pattern_match.group(1) | |
# Filters.regex(f'^!({")|(".join(cmd)})') | |
# args = message.text[length(message.matches[0].group(1)):] |
NewerOlder