diff options
author | lassulus <git@lassul.us> | 2023-04-17 14:30:48 +0200 |
---|---|---|
committer | lassulus <git@lassul.us> | 2023-04-17 14:32:09 +0200 |
commit | d8ca1ceb9d9f91b34312ca7f6645c97560907949 (patch) | |
tree | f8a2a9351b8ab2c14cf18a32d01020de0bac68f3 /krebs/2configs/reaktor2.nix | |
parent | c3a05871bd6423dda1db299746d4fc493868a788 (diff) |
reaktor2: add !bing command
Diffstat (limited to 'krebs/2configs/reaktor2.nix')
-rw-r--r-- | krebs/2configs/reaktor2.nix | 22 |
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 ]; }) ]; |