mattwwarren / twubot Goto Github PK
View Code? Open in Web Editor NEWStream chat and loyalty hubot
Home Page: https://prattlr.com
License: Other
Stream chat and loyalty hubot
Home Page: https://prattlr.com
License: Other
Set number of credits required for entry.
Set number of entries per person.
Random chance of an individual winning the thing
When we call robot.sendMessage directly, use discord rooms for discord, single twitch channel for twitch and leave room for youtube, however that will work (likely similar to Twitch).
Admin only functionality
Dynamic addition of ranks with !addrank rank cost
Static addition of ranks on startup with loading a file. Use a timeout to ensure brain loading.
!buyrank user - subtract the appropriate amount from the user and give them that rank
How to create/enforce superseding ranks via command?
Record user follow times
Populate previous followers in robot brain
Detect live times (and save total live time in ms; grab based on "connected" event)
Handle viewers' total view time (process on user join and part)
prattlr_1 | at Viewership.exports.Viewership.Viewership.userEnter (/opt/prattlr/lib/viewership.coffee:31:38)
prattlr_1 | at Listener.callback (/opt/prattlr/scripts/viewers.coffee:18:22)
prattlr_1 | at /opt/prattlr/node_modules/hubot/src/listener.coffee:53:21
prattlr_1 | at allDone (/opt/prattlr/node_modules/hubot/src/middleware.coffee:35:16)
prattlr_1 | at /opt/prattlr/node_modules/hubot/node_modules/async/lib/async.js:274:13
prattlr_1 | at Object.async.eachSeries (/opt/prattlr/node_modules/hubot/node_modules/async/lib/async.js:142:20)
prattlr_1 | at Object.async.reduce (/opt/prattlr/node_modules/hubot/node_modules/async/lib/async.js:268:15)
prattlr_1 | at /opt/prattlr/node_modules/hubot/src/middleware.coffee:39:24
prattlr_1 | at nextTickCallbackWith0Args (node.js:436:9)
prattlr_1 | at process._tickCallback (node.js:365:13)
This makes total sense because there is no check to see if the user exists. It is expected that the user will also be created on join.
Sup wit that?
Something along the lines of !count .*
Probably more robust than a rip counter.
We claim it works but maybe it doesn't
Could be a way to work around Twitch API integration for the time being. !live triggers a "we're going live" chat message, encouraging users to say hello for credits. Message can be configured with a file to HUBOT_TWITCH_LIVE
Commands in the database can be for users with a particular rank, followers or subscribers only. Save this information alongside the existing commands.
Example for call-n-response
!learn [all,sub,follow,${rank}] command response
Set via a list of items in the brain, remind the chat on a rotation to do things like follow on Twitch/Twitter, join Discord or sub to YouTube.
Robot.on "PluginConfigure"
Save enable/disable in brain
Robot.listen !plugin bankhack on
Robot.emit pluginConfigure bankhack on
!vote thing - default yes/no answers
!vote thing choice1 choice2 ... choicen
How do you differentiate between thing and choice1?
In preparation for multi-tenancy, we should namespace everything to the channel so we don't get users and other information crossed.
Currently I have the same three lines of code all over the place. Let's put it in one place and that will allow the ability to switch it out for a more intelligent system.
HUBOT_TWITCH_ADMINS = process.env.HUBOT_TWITCH_ADMINS?.split "," || []
HUBOT_TWITCH_OWNERS = process.env.HUBOT_TWITCH_OWNERS?.split "," || []
moderators = HUBOT_TWITCH_ADMINS.concat HUBOT_TWITCH_OWNERS
This gets hairy pretty quickly but a listener should do the job.
Current idea: create a list of rules that match messages and filter.
Filters:
https://www.npmjs.com/package/swearjar
MESSAGES IN ALL CAPS
Emoticon spam
Copy and paste spam (a fun scaling challenge for sure)
Link spam (particularly untrustworthy sites)
For the spam things, it should operate on a three strikes and you're out philosophy
From reddit:
Hello, I'm streaming a game that includes a battle royal system for me and 3 others to join in on. Currently the viewer pool is small enough for me to keep track of in my head, but it's still fairly hectic. I try to make it so that everyone has a fair chance to join in where last place in battle royal gets swapped out. While if multiple new viewers join, more people are swapped.
It has come to my attention that a bot using the same auth token will join all rooms it is authed to. This gets slightly complicated for hubot. We will need to experiment with how to detect the correct request/response across multiple guilds.
CONFIGURATION.md should be written from the pov of a new repo.
Link that to DEPLOYMENT.md and talk about npm install.
PLUGINS.md needs a list of plugins and what they do.
DEPLOYMENT.md to be fleshed out as we have more ways to deploy.
This will involve looking up more information than is currently available in the twitch adapter.
Experiment with Hugo. https://gohugo.io/overview/installing/
And make it a singleton
Each plugin should look up a string from the !command and use that as the regular expression (in addition to the !command)
This is the groundwork for internationalization so keep that in mind when creating a data file.
And make a 5 minute cron (configurable) for checking periodically
It would be nice to be able to leave the bot on and not get spammy with bankhack and reminder messages
Take all the auto-generated junk out of the existing and move it into INSTALL. Write better docs about how to actually run the project and how to use my services to make it easier.
!uptime - uptime of the stream (requires API integration)
!time - attendance time of the user (based on first watch value in user obj)
!checktime - check time of another user
From reddit:
I am streaming Pokemon and me and my mods have come up with an Elite 4 challenge. The only reason why it's not working at this point in time is because we wanted players to have the ability to buy revives for their team. So basically you type in a command which then sends a message to my bot telling it to take earned credits from their total balance. In exchange they for example get 1 revive which they can spend by using another command.
So from this, mod commands to manage the "shop" inventory (should items be limited? Optionally?) and all access to buy from the shop
Fixes the all info in one key problem. ๐
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.