Skip to content
Permalink
Browse files

Invite mode

  • Loading branch information...
Depado committed Aug 2, 2017
1 parent 80731fa commit f75e10f1f49c93ea811d97e8ae05d899e790fb60
Showing with 23 additions and 24 deletions.
  1. +16 −23 .drone.yml
  2. +5 −0 main.go
  3. +2 −1 plugins/anon/command.go
@@ -1,25 +1,18 @@
build:
image: armhfbuild/golang:$$GO_VERSION
commands:
- apt-get update
- apt-get install libmagic-dev
- go get github.com/axw/gocov
- go get github.com/mattn/goveralls
- go get golang.org/x/tools/cmd/cover
- go get
- go build
- go test ./...
pipeline:
build:
image: golang:${TAG}
commands:
- apt-get update
- apt-get install libmagic-dev
- go get github.com/axw/gocov
- go get github.com/mattn/goveralls
- go get golang.org/x/tools/cmd/cover
- go get
- go build
- go test

matrix:
GO_VERSION:
- 1.6
- 1.5

notify:
irc:
prefix: gob0tsec Build
nick: Depadrone
channel: n0sec-bot
server:
host: irc.freenode.net
port: 6667
TAG:
- 1.7
- 1.8
- latest
@@ -58,6 +58,11 @@ func main() {
ib.Join(cnf.Channel)
})

// Callback on 'Invite' event
ib.AddCallback("INVITE", func(e *irc.Event) {
ib.Join(cnf.Channel)
})

// Callback on 'Message' event
ib.AddCallback("PRIVMSG", func(e *irc.Event) {
from := e.Nick
@@ -40,7 +40,8 @@ func (c *Command) Get(ib *irc.Connection, from string, to string, args []string)
return
}
if len(args) > 0 {
ib.Privmsgf(configuration.Config.Channel, "[%s] %v", string(from[rand.Intn(len(from))]), strings.Join(args, " "))
// string(from[rand.Intn(len(from))])
ib.Privmsgf(configuration.Config.Channel, "[a] %v", strings.Join(args, " "))
}
}

0 comments on commit f75e10f

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