diff --git a/ChatGPT/config.py b/ChatGPT/config.py index d46cb6f..056e1c8 100644 --- a/ChatGPT/config.py +++ b/ChatGPT/config.py @@ -54,6 +54,16 @@ ChatGPT = conf.registerPlugin("ChatGPT") # This is where your configuration variables (if any) should go. For example: # conf.registerGlobalValue(ChatGPT, 'someConfigVariableName', # registry.Boolean(False, _("""Help for someConfigVariableName."""))) + +conf.registerChannelValue( + ChatGPT, + "enabled", + registry.Boolean( + True, + _("""Set False to disable the plugin, True to enable."""), + ), +) + conf.registerGlobalValue( ChatGPT, "api_key", diff --git a/ChatGPT/plugin.py b/ChatGPT/plugin.py index ce291be..1f36f3d 100644 --- a/ChatGPT/plugin.py +++ b/ChatGPT/plugin.py @@ -53,6 +53,8 @@ class ChatGPT(callbacks.Plugin): channel = msg.channel if not irc.isChannel(channel): channel = msg.nick + if not self.registryValue("enabled", msg.channel): + return if self.registryValue("nick_include", msg.channel): text = "%s: %s" % (msg.nick, text) self.history.setdefault(channel, None)