Skip to content

Instantly share code, notes, and snippets.

View x0x8x's full-sized avatar
🏠
Working from home

x0x8x x0x8x

🏠
Working from home
View GitHub Profile
# by @arthurwayne, I guess...
from datetime import datetime, date
import time
import os
import nltk
from nltk.corpus import stopwords
nltk.download("stopwords")
@x0x8x
x0x8x / main.py
Last active June 8, 2020 16:26
Telegram UserBot using Telethon framework and meval for eval func.
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
@x0x8x
x0x8x / autobio_autoname_autopic-for_telethonchat.py
Created June 3, 2020 18:02
autobio autoname autopic for t.me/telethonchat
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
@x0x8x
x0x8x / fetch_all_users-telethon.py
Last active December 22, 2020 14:18
fetch all users from the specific group and print their entities
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 = []
@x0x8x
x0x8x / wayneval.py
Created April 25, 2020 11:32
Infinitive STDOUT using textwrap under meval
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
@x0x8x
x0x8x / lambda_all_participants.py
Last active December 22, 2020 14:18
Will count all users messages of the specific group and print sorted out from most talked to none with an λ
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])
)
)(
(
@x0x8x
x0x8x / telethon_client.py
Created April 25, 2020 01:43
Simplest Telethon Client with an minimum of functionality
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:
@x0x8x
x0x8x / aioschedule_telethon.py
Created April 21, 2020 03:25
schedules in telethon
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,
from pyrogram import Filters, Message, Client
class custom(dict):
def __missing__(self, key):
return 0
COMMAND = "wcount"
# 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)):]