Bot that copies mod logs from twitch into discord.
- Install node.js
- run
npm install
- set up your config file
- run
node index.js
ornode index.js path/to/config/file.json
- Go to
https://discordapp.com/oauth2/authorize?client_id=
discord client ID&scope=bot&permissions=3072
and add it to your discord server.
The config file is a JSON document that defines parameters for the bot and the channels it listens to. See settings.default.json for a template. By default, it has to be called settings.json
DO NOT EDIT THE FILE WHILE THE BOT IS RUNNING, IT WILL GET OVERWRITTEN
You will need:
- A discord bot client ID and token
- A twitch account that is moderator in the channels that you plan to use, with its ID and any oauth (can have no scope whatsoever)
client_id
, token
, prefix
should be obvious. admins
is a list of discord user IDs that can use commands.
Unless using a load balancer for pubsub, pubsub_server
should be "wss://pubsub-edge.twitch.tv/v1".
mod.id
andmod.oauth
are the ID (not name!) and oauth of your twitch moderator account.ignored.users
is a list of usernames, for which theignored.actions
commands should be ignored.client_id
is any client_id to use (I could replace that with using the oauth, but I am planning to move to a multi-user system).
Note: mod.oauth
has to be generated by specified client_id
for !(un)listen
commands to work.
Listeners can be added on the fly using the commands below and shouldnt be added manually, but for the sake of completeness:
listeners
is a list of listeners (duh), each containing atwitch
and adiscord
object:twitch
is an object containingchannel_id
andchannel_name
(these should be matching, else you will run into trouble, but if you know what you are doing and have a reason to do so, you can deviate from that)discord
is an object containing just achannel_id
, the place where the modlogs from the twitch channel are sent to.
Commands are available to admins
in discord only.
Available commands are:
!help
- lists the available commands!invite
- gives a bot invite link!listen <channel>
- listens to the twitch channel "channel
" in the current channel!unlisten [channel]
- unlistens from the channel "channel
" in the current discord channel. If no channel is specified, it unlistens from all. If multiple are specified, it unlistens from all of them.!list
- gives a list of chanels the bot is listening to.