renge is our IRC support bot for AnimeBytes.
It supports the following commands for users in support channel:
!reenable <user>
- attempt to automatically reenable an existing disabled user!queue <reason>
- join a support queue which staff will handle!unqueue
- leave the queue after you've joined it
It supports the following commands for staff:
- In staff channel:
!queue
- view the current state of the queue!unqueue <position>
- remove someone from the queue based on their position in the queue!handle [position]
- start a new support session with someone from the queue by position; if none given, then first in the queue!handle <nick> <reason>
- start a support session with someone who is not in the queue!sessions
- view the currently active support sessions!kill <channel>
- end a current support session by channel name!reenable <user> [reason]
- reenable an existing disabled user with staff permissions!ip <nick>
- send the IP of a nick to the staff requester in a NOTICE. Nick must be in the queue or an active session!logs
- view the up to the last 10 completed support sessions and their log pastes
- In active support session
!reenable <user>
- reenable an existing disabled user with staff permissions
renge requires NodeJS v20.9 or later and Yarn package manager.
yarn --frozen-lockfile && yarn build
node dist/index.js
Example systemd unit file:
[Unit]
Description=renge
After=network.target
[Service]
Environment="LOG_LEVEL=info"
WorkingDirectory=/opt/renge
ExecStart=/usr/bin/node dist/index.js
RestartSec=10s
Restart=always
User=renge
[Install]
WantedBy=default.target
Alternatively, you can also build/use a docker container instead:
docker build . -t renge
docker run -d --restart=always -v ${PWD}/config.json:/app/config.json -v ${PWD}/logs:/app/logs -v ${PWD}/state.ldb:/app/state.ldb renge
Configuration is done via config.json
file which should be in the working directory of the application with the following format:
{
"state_db": "state.ldb",
"logs_dir": "logs",
"irc_server": "irc.example.com",
"irc_port": 6697,
"irc_use_ssl": true,
"irc_verify_ssl": true,
"irc_nick": "Renge",
"irc_realname": "Renge Miyauchi",
"irc_username": "Renge",
"oper_username": "",
"oper_pass": "",
"site_api_key": "",
"staff_channel": "#support-staff",
"user_channel": "#support",
"log_channel": "#support-logging",
"session_channels": ["#support-session1", "#support-session2", "#support-session3"],
"staff_hostmasks": ["*!*@*.Staff.Example"]
}
state_db
- full path where LevelDB database with persistent state such as the queue and active sessions are storedlogs_dir
- directory to store text logs of sessions after they are completedirc_server
- address of IRC server to connect toirc_port
- port of the IRC serverirc_use_ssl
- whether to use SSL or not when connecting to IRC serverirc_verify_ssl
- whether to verify the IRC server certificateirc_nick
- IRC nick to use for the botirc_realname
- IRC realname to use for the botirc_username
- IRC username to use for the botoper_username
- username to use when authenticating as IRC operatoroper_pass
- password to use when authenticating as IRC operatorsite_api_key
- api key to use with site (used when creating pastes or reenabling users)staff_channel
- IRC channel to listen for staff commands and announce newly queued usersuser_channel
- IRC channel to listen for user commandslog_channel
- IRC channel where active support sessions are loggedsession_channels
- array of IRC channels where support sessions between a user and staff should be heldstaff_hostmasks
- array of IRC-style hostmask for irc users which should be considered staff (ref)
Additionally the bot expects LOG_LEVEL
environment variable to be set to one of:
trace
debug
(default if not provided)info
warn
error