2022-03-10 23:00:37 +01:00
|
|
|
package main
|
|
|
|
|
2022-03-10 23:27:06 +01:00
|
|
|
import (
|
|
|
|
"github.com/gempir/go-twitch-irc/v3"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
)
|
|
|
|
|
2022-03-10 23:00:37 +01:00
|
|
|
func (nb *nourybot) connect() error {
|
|
|
|
nb.twitchClient.Join("nourybot")
|
|
|
|
|
2022-03-10 23:27:06 +01:00
|
|
|
logrus.Info("Connecting to Twitch...")
|
2022-03-10 23:00:37 +01:00
|
|
|
err := nb.twitchClient.Connect()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (nb *nourybot) onConnect() {
|
|
|
|
nb.twitchClient.Say("nourybot", "xd")
|
|
|
|
}
|
2022-03-10 23:27:06 +01:00
|
|
|
|
|
|
|
func (nb *nourybot) onPrivateMessage(message twitch.PrivateMessage) {
|
|
|
|
logrus.Info(message.Message)
|
|
|
|
}
|