Exclude send info update message #5

Merged
tema merged 1 commits from testing into master 2023-02-03 00:14:56 +03:00
3 changed files with 8 additions and 0 deletions

View File

@ -33,6 +33,11 @@ class Config():
usrs = self.config.get("Users", "admin_users").split(',')
return [int(user_id) for user_id in usrs]
@property
def exclude_send_msg(self):
usrs = self.config.get("Users", "exclude").split(',')
return [int(user_id) for user_id in usrs]
@property
def telegram_bot_api_server(self):
server = self.config.get("Bot", "telegram_bot_api_server")

View File

@ -20,6 +20,7 @@ link = https://example.com/parse_me
;Uncomment this variable, if you use filters to users
;allowed_users = 0,1,2,3
admin_users = 0,1,2,3
exclude = 1,2,3
[DataBase]
enable_logging = yes

View File

@ -16,6 +16,8 @@ async def announce():
message = "Ошибка обновления данных!"
if config.admin_user is not None:
for user_id in config.admin_user:
if user_id in config.exclude_send_msg:
continue
await dp.bot.send_message(user_id, message)