fugitech / kaet Goto Github PK
View Code? Open in Web Editor NEWChat bot for twitch.tv/kate
License: MIT License
Chat bot for twitch.tv/kate
License: MIT License
Continuing a conversation from the chat: the TCP connection between kaet and twitch irc will sometimes die and kaet won't notice. We should detect this in a Go-ish way and either die (so that monit will pick it back up and start it) or reconnect it ourselves (if this can be done easily enough).
There should be a guard against counter names being more than one word in the "inc"/"dec"/"reset" commands. If a multi-word counter is created it cannot be parsed as a command. The counter should probably only take the first word of the data and ignore the rest.
Example seen on stream: "!inc ACOG 1" created a counter "ACOG 1". You then can't access this counter because "!ACOG 1" is parsed as the "ACOG" command with an argument of "1")
Let's say some hapless fool calls !addcommand Help this streamer do great things!
because they forgot the command they wanted to define. This text then shadows !help for the lifetime of the bot's process, and also affects aliased commands like !halp
. !removecommand help
manages to remove the errant command but doesn't actually restore !help
's default behavior, so it actually removes the command (and any aliases like !halp
). (This also extends to !removecommand removecommand
, so, uh, be careful.)
We probably should detect when !addcommand or !removecommand would collide with a built-in and produce a helpful "I'm afraid I can't let you do that" type message.
Kate was talking about the idea of the bot calling out new subs in chat, like the mods are doing now.
Related APIs:
If you use "reset" the output says "0" but the counter is actually gone (and no longer available in commands). If you want a live counter with a value of 0 you have to create the counter with "inc"/"dec" and then use those commands to get the value to 0 (e.g. create a new counter with "inc" and "dec" back to 0). Perhaps "reset" and "removecounter" should be separate commands?
It doesn't seem like the streamer counts as a 'mod' for purpose of 'mod-only commands', meaning streamer can't easily create/delete their own commands.
Example debug output, showing the user-type being empty:
2017/07/24 16:52:36 [IN] @badges=moderator/1,subscriber/0,turbo/1;color=#5F5775;display-name=r4v5;emotes=433:65-66;id=156a2dbc-ff2f-404e-99fb-4abc589a2204;mod=1;room-id=113481237;subscriber=1;tmi-sent-ts=1500933155182;turbo=1;user-id=39399416;user-type=mod :r4v5![email protected] PRIVMSG #bengineering :Yep, still need to fix that so that the streamer counts as a mod
2017/07/24 16:52:51 [IN] @badges=broadcaster/1,subscriber/0;color=#DAA520;display-name=Bengineering;emotes=;id=c25b5f41-5884-48ff-b638-b9a58baba0ee;mod=0;room-id=113481237;sent-ts=1500933126760;subscriber=1;tmi-sent-ts=1500933170337;turbo=0;user-id=113481237;user-type= :bengineering![email protected] PRIVMSG #bengineering :ohhhh alright cool I thought I was crazy
Could be something like:
<@admin> !addcounter shark
<@kaet> Added counter shark
<someone> !shark
<@kaet> added 1 shark
<someone> !sharkcount
<@kaet> 420 total sharks
Counts persist forever.
Example: "ACOG" is a current counter. "!inc ACOG" and "!reset ACOG" work but "!ACOG" nor "!acog" do not work. It doesn't seem to matter whether the requesting user is a moderator or not.
Have not tested in practice, but I don't see any guards in the code against counter names overriding existing commands (built-in or mod-added).
Example: "!inc help" would override the "help" command with a counter. Also, "!reset help" would delete the "help" command without the checks present in "removecommand".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.