mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-04-25 20:41:21 -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:
|
# This is where your configuration variables (if any) should go. For example:
|
||||||
# conf.registerGlobalValue(ChatGPT, 'someConfigVariableName',
|
# conf.registerGlobalValue(ChatGPT, 'someConfigVariableName',
|
||||||
# registry.Boolean(False, _("""Help for 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(
|
conf.registerGlobalValue(
|
||||||
ChatGPT,
|
ChatGPT,
|
||||||
"api_key",
|
"api_key",
|
||||||
|
@ -53,6 +53,8 @@ class ChatGPT(callbacks.Plugin):
|
|||||||
channel = msg.channel
|
channel = msg.channel
|
||||||
if not irc.isChannel(channel):
|
if not irc.isChannel(channel):
|
||||||
channel = msg.nick
|
channel = msg.nick
|
||||||
|
if not self.registryValue("enabled", msg.channel):
|
||||||
|
return
|
||||||
if self.registryValue("nick_include", msg.channel):
|
if self.registryValue("nick_include", msg.channel):
|
||||||
text = "%s: %s" % (msg.nick, text)
|
text = "%s: %s" % (msg.nick, text)
|
||||||
self.history.setdefault(channel, None)
|
self.history.setdefault(channel, None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user