Skip to content
Permalink
Browse files

anon plugin: replace the [A] prefix by a random letter from the sende…

…r nickname
  • Loading branch information...
hekmon committed Jul 21, 2017
1 parent ddd8d83 commit 9deb0d712e8fef95afb26fd6819ec3f1bf8495cf
Showing with 4 additions and 2 deletions.
  1. +4 −2 plugins/anon/command.go
@@ -1,12 +1,13 @@
package anon

import (
"math/rand"
"strings"
"time"

"github.com/depado/go-b0tsec/configuration"
"github.com/depado/go-b0tsec/plugins"
"github.com/depado/go-b0tsec/utils"
"github.com/thoj/go-ircevent"
)

const (
@@ -19,6 +20,7 @@ type Command struct {
}

func init() {
rand.Seed(time.Now().Unix())
plugins.Commands[command] = new(Command)
}

@@ -37,7 +39,7 @@ func (c *Command) Get(ib *irc.Connection, from string, to string, args []string)
return
}
if len(args) > 0 {
ib.Privmsgf(configuration.Config.Channel, "[A] %v", strings.Join(args, " "))
ib.Privmsgf(configuration.Config.Channel, "[%s] %v", string(from[rand.Intn(len(from))]), strings.Join(args, " "))
}
}

0 comments on commit 9deb0d7

Please sign in to comment.
You can’t perform that action at this time.