def decorator(func): async def wrapper(check): if check.edit_date: return if check.fwd_from: return if check.is_group or check.is_private: pass else: # print("i don't work in channels") return users = gbanned.find({}) for c in users: if check.sender_id == c["user"]: return try: await func(check) try: LOAD_PLUG[file_test].append(func) except Exception: LOAD_PLUG.update({file_test: [func]}) except BaseException: return else: pass tbot.add_event_handler(wrapper, events.NewMessage(**args)) return wrapper
def decorator(func): tbot.add_event_handler(func, events.UserUpdate(**args)) return func
def decorator(func): tbot.add_event_handler(func, events.ChatAction(**args)) return func
def decorator(func): tbot.add_event_handler(func, events.CallbackQuery(**args)) return func
def decorator(func): tbot.add_event_handler(func, events.InlineQuery(**args)) return func