diff --git a/ChatGPT/config.py b/ChatGPT/config.py index 48847e5..aa57571 100644 --- a/ChatGPT/config.py +++ b/ChatGPT/config.py @@ -77,6 +77,32 @@ conf.registerChannelValue( ), ) +conf.registerChannelValue( + ChatGPT, + "reply_intact", + registry.Boolean( + False, + _( + """ + Get spammy and enable line per line reply... + """ + ), + ), +) + +conf.registerChannelValue( + ChatGPT, + "nick_prefix", + registry.Boolean( + True, + _( + """ + Prefix nick on replies true/false... + """ + ), + ), +) + conf.registerChannelValue( ChatGPT, "temperature", diff --git a/ChatGPT/plugin.py b/ChatGPT/plugin.py index f1bdc36..e0d82c3 100644 --- a/ChatGPT/plugin.py +++ b/ChatGPT/plugin.py @@ -59,8 +59,14 @@ class ChatGPT(callbacks.Plugin): frequency_penalty=self.registryValue("frequency_penalty", msg.channel), user=msg.nick, ) - response = " ".join(completion.choices[0].message.content.splitlines()) - irc.reply(response) + prefix = self.registryValue("nick_prefix", msg.channel) + if self.registryValue("reply_intact", msg.channel): + for line in completion.choices[0].message.content.splitlines(): + if line: + irc.reply(line, prefixNick=prefix) + else: + response = " ".join(completion.choices[0].message.content.splitlines()) + irc.reply(response, prefixNick=prefix) chat = wrap(chat, ["text"])