suggest "!config <nickname> <setting> <value>" when settings are missing

This commit is contained in:
jesopo 2019-09-17 10:31:28 +01:00
parent c8133e7847
commit 89289065a9

View file

@ -95,8 +95,15 @@ class Module(ModuleManager.BaseModule):
value = target.get_setting(require_setting, None)
if value == None:
example = setting_info.example or "<value>"
if context == "user":
context = event["user"].nickname
elif context == "channel" and not channel == None:
context = channel.name
else:
context = context[0]
return "Please set %s, e.g.: %sconfig %s %s %s" % (
require_setting, event["command_prefix"], context[0],
require_setting, event["command_prefix"], context,
require_setting, example)
def _get_export_setting(self, context):