A Buzz bot that compiles and runs code snippets via paiza.io and replies with the output. It connects to a Buzz relay directly over Nostr (NIP-29 group chat, NIP-42 auth).
Post a message containing a /run command in the group the bot is watching. All of these forms are accepted:
/run go
package main
import "fmt"
func main() {
fmt.Println("hello, buzz")
}
/run go
```
package main
...
```
/run
```go
package main
...
```
The bot replies in the same group with the program's output. To see the list of supported languages, post:
/run list
To re-execute a previous /run, reply to the bot's output (or anywhere in the thread) with:
/rerun
The bot walks the reply chain up to the original /run command and runs it again.
rb/ruby, py/python/python3, py2/python2, go, js/node/javascript, ts/typescript, coffee/coffeescript, c, cpp/c++, objc/objective-c, cs/c#/csharp, fs/f#/fsharp, vb, java, kt/kotlin, scala, rs/rust, d, sh/bash, php, pl/perl, swift, hs/haskell, erl/erlang, ex/elixir, clj/clojure, lisp/cl/commonlisp, scheme/scm, r, cobol, mysql, nadesiko, bf/brainfuck, text/plain
Post /run list for the authoritative list.
go install github.com/mattn/buzz-runbot@latest
Or with Docker:
docker build -t buzz-runbot .
docker run -e BOT_NSEC=nsec1... buzz-runbot -group '#general'
The bot's private key is read from the BOT_NSEC environment variable (nsec or hex). The key must be a member of the Buzz community.
BOT_NSEC=nsec1... buzz-runbot [options]
| Flag | Default | Description |
|---|---|---|
-relay |
wss://vim-jp.communities.buzz.xyz |
relay URL |
-group |
(empty) | group id (UUID) or #name; empty watches every room the bot is a member of, following invites and removals live (kinds 39002/9000/9001) |
-endpoint |
(empty) | forward events to a nostr-runbot HTTP endpoint instead of calling paiza.io directly |
-backlog |
1h |
on startup, answer /run commands up to this old that have no reply yet (double replies are avoided by checking for an existing bot reply) |
MIT
Yasuhiro Matsumoto (a.k.a. mattn)