Browse Source

Fixed multiple connect

master^2
witer33 2 years ago
parent
commit
1505b9aba3
2 changed files with 1 additions and 7 deletions
  1. +0
    -1
      README.md
  2. +1
    -6
      twitchbot/bot.go

+ 0
- 1
README.md View File

@ -10,7 +10,6 @@ import (
) )
func main() { func main() {
bot := twitchbot.NewBot("oauth:abcdef", "mybot", []string{"channel"}) bot := twitchbot.NewBot("oauth:abcdef", "mybot", []string{"channel"})
bot.OnMessage(func(bot *twitchbot.Bot, message *twitchbot.Message) { bot.OnMessage(func(bot *twitchbot.Bot, message *twitchbot.Message) {

+ 1
- 6
twitchbot/bot.go View File

@ -132,13 +132,8 @@ func (bot *Bot) Run() {
} }
func (bot *Bot) Start() error { func (bot *Bot) Start() error {
err := bot.client.Connect(bot.host)
if err != nil {
return err
}
defer bot.client.Close() defer bot.client.Close()
err = bot.client.Connect(bot.host)
err := bot.client.Connect(bot.host)
if err != nil { if err != nil {
return err return err
} }

Loading…
Cancel
Save