build.handlers.users.unknown_symbol.bot_message()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 16
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 16
rs 10
c 0
b 0
f 0
cc 1
nop 1
1
# -*- coding: utf-8 -*-
2
3
4
from utils.misc.throttling import rate_limit
5
from aiogram import types
6
from loader import dp
7
import asyncio
8
9
10
"""
11
12
    Created on 10.09.2021
13
14
    @author: Nikita
15
16
17
"""
18
19
20
@rate_limit(5, 'unknown_symbol')
21
@dp.message_handler(regexp=r'^[\W]+$')
22
async def bot_message(message: types.Message):
23
24
    """
25
26
    The function is designed for processing messages
27
    consist of only symbols punctuation, empty symbols and etc.
28
29
    """
30
31
    await types.ChatActions.typing()
32
33
    await message.answer("Упс...")
34
    await asyncio.sleep(2)
35
    await message.answer("Что-то я Вас не понял, попробуйте сформулировать мысль яснее 🧐")
36