From 1505b9aba3faed8c421e966e43f30e6220611c30 Mon Sep 17 00:00:00 2001 From: witer33 Date: Mon, 3 Jan 2022 18:41:57 +0100 Subject: [PATCH] Fixed multiple connect --- README.md | 1 - twitchbot/bot.go | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/README.md b/README.md index 6c28a47..4aab41e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ import ( ) func main() { - bot := twitchbot.NewBot("oauth:abcdef", "mybot", []string{"channel"}) bot.OnMessage(func(bot *twitchbot.Bot, message *twitchbot.Message) { diff --git a/twitchbot/bot.go b/twitchbot/bot.go index 977915c..4409409 100644 --- a/twitchbot/bot.go +++ b/twitchbot/bot.go @@ -132,13 +132,8 @@ func (bot *Bot) Run() { } func (bot *Bot) Start() error { - err := bot.client.Connect(bot.host) - if err != nil { - return err - } - defer bot.client.Close() - err = bot.client.Connect(bot.host) + err := bot.client.Connect(bot.host) if err != nil { return err }