INNER CODE UNIT · Python
setup_chat_notifications
sidor0912/FunPayCardinal · tg_bot/bot.py:272
def setup_chat_notifications(self, bot: TGBot, m: Message):
"""
Устанавливает настройки уведомлений по умолчанию в новом чате.
"""
if str(m.chat.id) in self.notification_settings and m.from_user.id in self.authorized_users and \
self.is_notification_enabled(m.chat.id, NotificationTypes.critical):
return
elif str(m.chat.id) in self.notification_settings and m.from_user.id in self.authorized_users and not \
self.is_notification_enabled(m.chat.id, NotificationTypes.critical):
self.notification_settings[str(m.chat.id)][NotificationTypes.critical] = 1
utils.save_notification_settings(self.notification_settings)
return
elif str(m.chat.id) not in self.notification_settings:
self.notification_settings[str(m.chat.id)] = self.__default_notification_settings.copy()
utils.save_notification_settings(self.notification_settings)
def reg_admin(self, m: Message):
"""