uberswe / twitchbot

A web application to allow users to make their own Twitch chat bots
https://bot.uberswe.com/
MIT License
2 stars 0 forks source link

A host with 0 viewers is not detected, there is no message received #13

Open uberswe opened 4 years ago

uberswe commented 4 years ago

Ok, it kinda worked today. I saw this message but I need better logging

2020/03/17 00:55:31 Command detected: !so @uberswe
2020/03/17 00:55:31 Found a variable at position 4: "{user}"
2020/03/17 00:55:31 Length of pieces is 2 greater than index 1
2020/03/17 00:55:31 Replacing {user} "{user}" in "Check out and follow @{user}! https://twitch.tv/{user}" with "uberswe"
2020/03/17 00:55:31 Bot responded to !so @uberswe in channel uberswe: Check out and follow @uberswe! https://twitch.tv/uberswe
2020/03/17 00:55:31 New message detected: [uberswe] Check out and follow @uberswe! https://twitch.tv/uberswe
2020/03/17 00:58:44 Ping received: tmi.twitch.tv
2020/03/17 00:59:02 Bot Ping received: tmi.twitch.tv
2020/03/17 00:59:11 Ping received: tmi.twitch.tv
2020/03/17 01:01:42 New message detected: [theophena] uberswe is now hosting you.
2020/03/17 01:03:12 Ping received: tmi.twitch.tv

More specifically the second to last message there

uberswe commented 4 years ago

Some better logging

2020/03/17 18:12:13 New message detected: [theophena] uberswe is now hosting you.
2020/03/17 18:12:13 {{ jtv   map[]} :jtv!jtv@jtv.tmi.twitch.tv PRIVMSG theophena :uberswe is now hosting you. 1 PRIVMSG map[] uberswe is now hosting you. theophena   0001-01-01 00:00:00 +0000 UTC [] 0 false}

This happens in

client.OnPrivateMessage(func(message twitch.PrivateMessage) {
        log.Println(fmt.Sprintf("New message detected: [%s] %s", message.Channel, message.Message))
        log.Printf("%v\n", message)
    })

But only for the user, the bot does not see this message

uberswe commented 4 years ago

Maybe we don't want to detect this. Twitch might filter this out on purpose so we don't show notifications for 0 viewer hosts/raids. Further testing with the bots are needed