-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
39 lines (32 loc) · 883 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"log"
"os"
"strings"
"github.com/StalkR/goircbot/bot"
"github.com/thomasschuiki/go-ircbot/commands/chucknorris"
"github.com/thomasschuiki/go-ircbot/commands/covid"
"github.com/thomasschuiki/go-ircbot/commands/meme"
"github.com/thomasschuiki/go-ircbot/commands/saascat"
)
func main() {
var host = os.Getenv("IRCSERVER")
var channels = strings.Split(os.Getenv("IRCCHANNELS"), ",")
var ident = os.Getenv("IRCUSER")
var nick = os.Getenv("IRCNICK")
var ssl = false
var commandPrefix = "!"
b, err := bot.NewBotOptions(bot.Host(host), bot.Nick(nick), bot.SSL(ssl), bot.Ident(ident),
bot.Channels(channels),
bot.CommandPrefix(commandPrefix))
if err != nil {
log.Fatalf("failed to init new bot: %v", err)
}
// register plugins
chucknorris.Register(b)
covid.Register(b)
meme.Register(b)
saascat.Register(b)
// run the bot
b.Run()
}