Allow substitution of bot's nick in RunCommands

This commit is contained in:
Kufat
2022-09-05 21:16:56 -04:00
parent 0c83946983
commit 6a5c1ea51c
2 changed files with 4 additions and 2 deletions
+1
View File
@@ -243,6 +243,7 @@ func (b *Birc) handlePrivMsg(client *girc.Client, event girc.Event) {
func (b *Birc) handleRunCommands() {
for _, cmd := range b.GetStringSlice("RunCommands") {
cmd = strings.ReplaceAll(cmd, "{BOTNICK}", b.Nick)
if err := b.i.Cmd.SendRaw(cmd); err != nil {
b.Log.Errorf("RunCommands %s failed: %s", cmd, err)
}