Total Complexity | 1 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
2 | |||
3 | |||
4 | from utils.misc.throttling import rate_limit |
||
5 | from utils.misc.tg_html import mention_html |
||
6 | from aiogram import types |
||
7 | from loader import dp |
||
8 | |||
9 | |||
10 | """ |
||
11 | |||
12 | Created on 10.09.2021 |
||
13 | |||
14 | @author: Nikita |
||
15 | |||
16 | |||
17 | """ |
||
18 | |||
19 | |||
20 | @rate_limit(10, 'start') |
||
21 | @dp.message_handler(commands='start') |
||
22 | async def bot_start(message: types.Message): |
||
23 | |||
24 | """ |
||
25 | |||
26 | |||
27 | The function is designed to welcome a new bot user. |
||
28 | |||
29 | |||
30 | """ |
||
31 | |||
32 | await types.ChatActions.typing() |
||
33 | |||
34 | first_name = message.from_user.first_name |
||
35 | |||
36 | devs_id = await mention_html("no_n1ce", "Nikita") |
||
37 | |||
38 | await message.answer( |
||
39 | text=f"Привет, {first_name}! Я создатель этого разговорного чат-бота 🤔." |
||
40 | f" По всем вопросам, можешь написать мне {devs_id}!", |
||
41 | parse_mode=types.ParseMode.HTML) |
||
42 |