Exclude send info update message #5
@ -32,6 +32,11 @@ class Config():
|
||||
def admin_user(self):
|
||||
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):
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user