summaryrefslogtreecommitdiffstats
path: root/krebs/2configs
diff options
context:
space:
mode:
authorlassulus <git@lassul.us>2023-04-17 14:30:48 +0200
committerlassulus <git@lassul.us>2023-04-17 14:32:09 +0200
commitd8ca1ceb9d9f91b34312ca7f6645c97560907949 (patch)
treef8a2a9351b8ab2c14cf18a32d01020de0bac68f3 /krebs/2configs
parentc3a05871bd6423dda1db299746d4fc493868a788 (diff)
reaktor2: add !bing command
Diffstat (limited to 'krebs/2configs')
-rw-r--r--krebs/2configs/reaktor2.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/krebs/2configs/reaktor2.nix b/krebs/2configs/reaktor2.nix
index 39039cc11..032932013 100644
--- a/krebs/2configs/reaktor2.nix
+++ b/krebs/2configs/reaktor2.nix
@@ -51,6 +51,27 @@ let
};
};
+ bing = {
+ pattern = "!bing (.*)$";
+ activate = "match";
+ arguments = [1];
+ timeoutSec = 42;
+ command = {
+ filename = pkgs.writeDash "bing" ''
+ set -efu
+ export PATH=${makeBinPath [
+ pkgs.coreutils
+ pkgs.curl
+ pkgs.jq
+ ]}
+ printf '%s' "$*" |
+ curl -SsG http://bing-gpt.r/api/chat --data-urlencode 'prompt@-' |
+ jq -r '.item.messages[1].text' |
+ echo "$_from: $(cat)"
+ '';
+ };
+ };
+
confuse = {
pattern = "!confuse (.*)$";
activate = "match";
@@ -526,6 +547,7 @@ in {
(systemPlugin {
extra_privmsg_hooks = [
confuse
+ bing
];
})
];