build.utils.notify_admins.on_startup_notify()   A
last analyzed

Complexity

Conditions 3

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 12
rs 10
c 0
b 0
f 0
cc 3
nop 1
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