Normalize all commands
Jes Olson j3s@c3f.net
Sun, 20 Mar 2022 18:00:17 -0400
1 files changed,
13 insertions(+),
9 deletions(-)
jump to
M
main.go
→
main.go
@@ -74,20 +74,24 @@ fmt.Println("old detected")
// shittily trim the string e.Message = e.Message[1:] } - if e.Message == "stop" { + if e.Message == "stop" || e.Message == "!stop" { fmt.Println("stopping") stream.Stop() return } - if e.Message == "!help" { - helpmsg := `<br> - <h1>help</h1> + if e.Message == "help" || e.Message == "!help" { + helpmsg := ` + <h4>help</h4> <pre>!help</pre> - <h1>list sounds</h1> - <pre>list</pre> - <h1>make youtube vid into sound</h1> + <h4>stop current sound</h4> + <pre>!stop</pre> + <h4>set volume of playing sound</h4> + <pre>!vol 0-100</pre> + <h4>list sounds</h4> + <pre>!list</pre> + <h4>make youtube vid into sound</h4> <pre>!https://www.youtube.com/watch?v=dQw4w9WgXcQ > rickroll</pre> - <h1>make personal intro</h1> + <h4>make personal intro</h4> <pre>!intro rickroll</pre>` e.Sender.Send(helpmsg) }@@ -113,7 +117,7 @@ log.Fatal(err)
} e.Sender.Send("your intro has been set to " + introSelection) } - volmatched, err := regexp.MatchString(`^vol [0-9]+$`, e.Message) + volmatched, err := regexp.MatchString(`^!?vol [0-9]+$`, e.Message) if err != nil { fmt.Printf("regex match blew up: %s", err) return