A Twitch chatbot for organising riichi mahjong matches
This bot is set up using NodeJS, and therefore requires a local instance of Node to be run. As usual, cmd
into the project root and execute npm install
to install all dependencies, then tell Node to execute bot.js
.
For this to be functional, a .env
file with the parameters BOT_USERNAME
, BOT_COMMAND
, OAUTH_TOKEN
, CHANNEL_NAME
and ME
is required in the root of the project. This repo will not have one committed to code for personal data security purposes.
All Botjong commands start with the command listed in .env.BOT_COMMAND
followed by a request and an optional target.
join
: adds your name to the waiting list - you can also use!batjoin
as a shortcutleave
: removes your name from the waiting listlist OR list -waiting
: displays the names of all of the waiting playerslist -total
: displays the total number of players on the waiting listlist -ready
: lists all of the tables waiting to startlist -playing
: lists all of the tables with active gamesplay
: tell the bot to start your ready tableplay [room]
: tell the bot your ready table has the [room] number and start the matchnotify [room]
: notify a table with the MJS [room] numberlewds
: randomly generate a lewd link (you perverts) - invisible timer controlled to avoid link spamhelp
: returns a link to a list of commands for this bot
add [name]
: add a player to the waiting listremove [name]
: remove a player from the waiting listremove -all
: remove all players from the waiting listcloseready [id]
: remove a table from the waiting listcloseready -all
: remove all tables from the waiting listcloseplaying [id]
: remove a table from the playing listcloseplaying -all
: remove all tables from the playing liststart [id]
: start a tablereset
: empty all tracking listscreate [-order/-random]
: automatically try to create tables with the current waiting listauto [-on/-off]
: set autogen checking flag on/off -> joining will either trigger a tablegen check or tablegen is manualtype [-order/-random]
: set tablegen type flag -> order creates tables in join order, random is random, only applies when auto=truelog
: output all tracking lists toconsole.log()
This bot, when set to auto -on
, will check the number of players joining, and when there is enough for a table, will automatically generate the table. auto
can be turned -off
, and table generation can be done manually if a -random
sorting order is preferred - this is good for large groups of players starting matches at the same time. Waiting room size check may be command-set in the future to determine what size the waiting room should be at before automatic table generation is triggered.
The intention for this bot is to track any waiting players and automatically create a table ID once there is enough to make a table. As there is no way to hook into MJS to create a table and assign player IDs, all table creation must be handled manually - the bot is for tracking players and games only. Players must reregister for a match whenever they are ready, and leave
if they no longer wish to be tracked for a match.