mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-12 18:12:41 +00:00
28 lines
424 B
Go
28 lines
424 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
|
||
|
"github.com/go-irc/irc"
|
||
|
"github.com/pkg/errors"
|
||
|
)
|
||
|
|
||
|
func init() {
|
||
|
registerAction(func(c *irc.Client, m *irc.Message, r *ruleAction) error {
|
||
|
if r.Ban == nil {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
return errors.Wrap(
|
||
|
c.WriteMessage(&irc.Message{
|
||
|
Command: "PRIVMSG",
|
||
|
Params: []string{
|
||
|
m.Params[0],
|
||
|
fmt.Sprintf("/ban %s %s", m.User, *r.Ban),
|
||
|
},
|
||
|
}),
|
||
|
"sending timeout",
|
||
|
)
|
||
|
})
|
||
|
}
|