mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-04-25 12:31:07 -05:00
ChatGPT: Add 'enabled' config
This commit is contained in:
parent
1ca50ad0a4
commit
a5b09877e0
@ -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",
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user