Example #1
0
        async def new_func(message, *args, **def_kwargs):

            if RATE_LIMIT and await prevent_flooding(message,
                                                     message.text) is False:
                return

            if allow_kwargs is False:
                def_kwargs = dict()
            await func(message, *args, **def_kwargs)
            raise SkipHandler()
Example #2
0
        async def new_func(message, *args, **def_kwargs):

            if RATE_LIMIT and await prevent_flooding(message, message.text) is False:
                return

            if allow_kwargs is False:
                def_kwargs = dict()
            if DEBUG_MODE:
                logger.debug('[*] Starting {}.'.format(func.__name__))
                start = time.time()
                await func(message, *args, **def_kwargs)
                logger.debug('[*] {} Time: {} sec.'.format(func.__name__, time.time() - start))
            else:
                await func(message, *args, **def_kwargs)
            raise SkipHandler()
Example #3
0
        async def new_func(*def_args, **def_kwargs):
            message = def_args[0]

            if cmds:
                message.conf['cmds'] = cmds

            if allow_kwargs is False:
                def_kwargs = dict()

            if DEBUG_MODE:
                # log.debug('[*] Starting {}.'.format(func.__name__))
                # log.debug('Event: \n' + str(message))
                start = time.time()
                await func(*def_args, **def_kwargs)
                log.debug('[*] {} Time: {} sec.'.format(func.__name__, time.time() - start))
            else:
                await func(*def_args, **def_kwargs)
            raise SkipHandler()
Example #4
0
async def watch_get(m: types.Message, user: dict, chat: dict):
    get = await bot.send_message(
        m.chat.id, text=hbold('🎉 GET /hw/ 4️⃣0️⃣0️⃣0️⃣0️⃣0️⃣0️⃣'))
    try:
        await bot.pin_chat_message(m.chat.id,
                                   get.message_id,
                                   disable_notification=False)
    except:
        pass

    await bot.send_message(
        94026383,
        text='GET @{} {}'.format(
            m.chat.username,
            hlink(str(get.message_id),
                  'https://t.me/{}/{}'.format(m.chat.username,
                                              get.message_id))))
    SkipHandler()
Example #5
0
        async def new_func(*def_args, **def_kwargs):
            message = def_args[0]

            if allow_kwargs is False:
                def_kwargs = dict()

            # Sentry
            with configure_scope() as scope:
                scope.set_extra("update", str(message))

            if DEBUG_MODE:
                # log.debug('[*] Starting {}.'.format(func.__name__))
                # log.debug('Event: \n' + str(message))
                start = time.time()
                await func(*def_args, **def_kwargs)
                log.debug('[*] {} Time: {} sec.'.format(
                    func.__name__,
                    time.time() - start))
            else:
                await func(*def_args, **def_kwargs)
            raise SkipHandler()
Example #6
0
async def watch_get_six(m: types.Message, user: dict, chat: dict):
    pic_url = 'https://user-images.githubusercontent.com/24507532/97610210-a0decc00-1a25-11eb-9622-7b1e3536dfc0.png'
    get = await bot.send_message(
        m.chat.id,
        text=hide_link(pic_url) + hbold('🎉 GET /hw/ 6️⃣0️⃣0️⃣0️⃣0️⃣0️⃣0️⃣') +
        '\n\n' +
        "Забавный факт - если поделить гет на 100, то получится цена RTX 3070!"
    )
    try:
        await bot.pin_chat_message(m.chat.id,
                                   get.message_id,
                                   disable_notification=False)
    except:
        pass

    await bot.send_message(
        94026383,
        text='GET @{} {}'.format(
            m.chat.username,
            hlink(str(get.message_id),
                  'https://t.me/{}/{}'.format(m.chat.username,
                                              get.message_id))))
    SkipHandler()
Example #7
0
        async def new_func(*def_args, **def_kwargs):
            message = def_args[0]

            if cmds:
                message.conf['cmds'] = cmds

            if allow_kwargs is False:
                def_kwargs = {}

            with configure_scope() as scope:
                parsed_update = parse_update(dict(message))
                scope.set_extra("update", str(parsed_update))

            if CONFIG.debug_mode:
                # log.debug('[*] Starting {}.'.format(func.__name__))
                # log.debug('Event: \n' + str(message))
                start = time.time()
                await func(*def_args, **def_kwargs)
                log.debug('[*] {} Time: {} sec.'.format(
                    func.__name__,
                    time.time() - start))
            else:
                await func(*def_args, **def_kwargs)
            raise SkipHandler()
Example #8
0
async def only_admin_handler(message: types.Message):
    if message.chat.id in config.admins:
        raise SkipHandler()
Example #9
0
 async def new_func(*args, **def_kwargs):
     if 'allow_kwargs' not in kwargs:
         def_kwargs = dict()
     await func(*args, **def_kwargs)
     raise SkipHandler()
Example #10
0
 async def new_func(*args, **kwargs):
     await func(*args, **kwargs)
     raise SkipHandler()