build.utils.notify_admins   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 12
dl 0
loc 32
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A on_startup_notify() 0 12 3
1
# -*- coding: utf-8 -*-
2
3
4
from data.config import ADMINS
5
from aiogram import Dispatcher
6
import logging
7
8
9
"""
10
11
12
Created on 10.09.2021
13
14
@author: Nikita
15
16
17
"""
18
19
20
async def on_startup_notify(dp: Dispatcher):
21
22
    for admin in ADMINS:
23
24
        try:
25
            data_bot = await dp.bot.get_me()
26
27
            await dp.bot.send_message(admin,
28
                                      f"{data_bot.first_name} успешно запущен!")
29
30
        except Exception as err:
31
            logging.exception(err)
32