36 lines
534 B
Go
36 lines
534 B
Go
package main
|
|
|
|
import (
|
|
_ "embed"
|
|
"log"
|
|
"os"
|
|
|
|
"go.elara.ws/salix"
|
|
)
|
|
|
|
//go:embed replybot.salix.txt
|
|
var tmpl string
|
|
|
|
var matches = [][]string{
|
|
{"https://i.imgur.com/aaaaaaa.jpg", "aaaaaaa.jpg"},
|
|
{"https://imgur.com/a/bbbbbbb.jpg", "a/bbbbbbb.jpg"},
|
|
}
|
|
|
|
func main() {
|
|
vars := map[string]any{
|
|
"type": "post",
|
|
"matches": matches,
|
|
}
|
|
|
|
t, err := salix.New().
|
|
ParseString("replybot.salix.txt", tmpl)
|
|
if err != nil {
|
|
log.Fatalln(err)
|
|
}
|
|
|
|
err = t.WithVarMap(vars).Execute(os.Stdout)
|
|
if err != nil {
|
|
log.Fatalln(err)
|
|
}
|
|
}
|