Add ability to prevent users specifying their own dns nameservers
This commit is contained in:
parent
e1da095023
commit
8a4d5b3123
1 changed files with 10 additions and 6 deletions
|
@ -15,6 +15,8 @@ class DnsSetting(utils.Setting):
|
|||
return value
|
||||
return None
|
||||
|
||||
@utils.export("botset", utils.BoolSetting("configurable-nameservers",
|
||||
"Whether or not users can configure their own nameservers"))
|
||||
@utils.export("serverset", DnsSetting("dns-nameserver",
|
||||
"Set DNS nameserver", example="8.8.8.8"))
|
||||
@utils.export("channelset", DnsSetting("dns-nameserver",
|
||||
|
@ -28,6 +30,8 @@ class Module(ModuleManager.BaseModule):
|
|||
:prefix: DNS
|
||||
"""
|
||||
args = event["args_split"][:]
|
||||
nameserver = None
|
||||
if self.bot.get_setting("configurable-nameservers", True):
|
||||
nameserver = event["channel"].get_setting("dns-nameserver",
|
||||
event["server"].get_setting("dns-nameserver", None))
|
||||
for i, arg in enumerate(args):
|
||||
|
|
Loading…
Reference in a new issue