]> git.openfl.eu Git - twitch-chat.git/commitdiff
fixes main
authorFl_GUI <flor.guilini@hotmail.com>
Sat, 7 Dec 2024 14:05:27 +0000 (15:05 +0100)
committerFl_GUI <flor.guilini@hotmail.com>
Sat, 7 Dec 2024 14:05:27 +0000 (15:05 +0100)
twitch/chatclient.go
twitch/core/auth.go

index 2cca6d1d51c41b61c4e4fca08efef489ed3d360d..854c159ba33f254e6d0aca2857d5c128fdcfd0f6 100644 (file)
@@ -31,7 +31,7 @@ func (c ChatClient) Close() {
 
 func (c *ChatClient) WithAuthentication(nickname, accessToken string) {
        c.nickname = nickname
-       accessToken = accessToken
+       c.accessToken = accessToken
 }
 
 func (c *ChatClient) WithoutAuthentication() {
@@ -108,6 +108,9 @@ func (c *ChatClient) pingPong() {
 }
 
 func (c *ChatClient) askCapabilities() error {
+       if len(c.capabilities) == 0 {
+               return nil
+       }
        var caps = make([]string, 0, len(c.capabilities))
        for c, _ := range c.capabilities {
                caps = append(caps, c)
index 294dab2510e5d19bf45ad468f0b8ead5dc9e1a17..63aaf1184304fc1ca7fdb5ae0552a8ca9cf7e879 100644 (file)
@@ -9,7 +9,7 @@ import (
        "fl-gui.name/twitchchat/twitch/core/notice"
 )
 
-// see https://dev.twitch.tv/docs/irc/authenticate-bot/#sending-the-pass-and-nick-messages.
+// see https://dev.twitch.tv/docs/chat/irc/#authenticating-with-the-twitch-irc-server
 // The nickname should be the lowercase login name of the Twitch account used to get your access token
 func (c *Conn) Authenticate(nickname, access_token string, msgs <-chan messages.Message) (<-chan messages.Message, error) {
        res := make(chan messages.Message)