mirror of
https://gitflic.ru/project/alt-gnome/karkas.git
synced 2024-12-24 00:33:06 +03:00
вынес сообщение глобального фильтра в конфиг
This commit is contained in:
parent
ea7e12c5ed
commit
5a76e94c41
@ -49,9 +49,7 @@ class GlobalFilter(BaseMiddleware):
|
|||||||
if config.get("filters::global::private_allowed"):
|
if config.get("filters::global::private_allowed"):
|
||||||
return await handler(event, data)
|
return await handler(event, data)
|
||||||
|
|
||||||
await event.answer("НЕЛЬЗЯ!")
|
return await event.answer(config.get("filters::global::forbidden_message"))
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
def module_init():
|
def module_init():
|
||||||
@ -59,7 +57,11 @@ def module_init():
|
|||||||
"filters::approved_chat_id", "int", multiple=True, shared=True, default_value=[]
|
"filters::approved_chat_id", "int", multiple=True, shared=True, default_value=[]
|
||||||
)
|
)
|
||||||
config.register("filters::default_chat_tag", "string", shared=True)
|
config.register("filters::default_chat_tag", "string", shared=True)
|
||||||
|
config.register(
|
||||||
|
"filters::global::forbidden_message",
|
||||||
|
"string",
|
||||||
|
default_value="Вы не имеете доступа!",
|
||||||
|
)
|
||||||
config.register("filters::global::enabled", "boolean", default_value=False)
|
config.register("filters::global::enabled", "boolean", default_value=False)
|
||||||
config.register("filters::global::private_allowed", "boolean", default_value=False)
|
config.register("filters::global::private_allowed", "boolean", default_value=False)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user