elo-discord
is a self-hosted discord bot controller, with the intention of being modular.
node v12
/nvm
npm
/yarn
git clone https://github.com/Elocast/elo-discord.git
nvm use v12
(optional)- Configure env variables (look below)
yarn install
/npm install
yarn start
/npm install
TIP: if you're using linux, you can run the app with pm2 in order to have it monitored and run in the background. If you're not worried for the downtime, a simple screen
session should do the job just well.
elo-discord
config is based on environmental variables, for which we use dotenv
package; you'll have to create a .env
file, in the root directory with required env variables. Use .env-example
file as a guide, to what variables you have to configure. Naturally, if you're using docker, you'll specify environment variables through docker cli.
BOT_TOKEN
is an OAuth2 access token you'll be using to take control over the bot.
ELOCAST_API_URL
shouldn't be changed, unless you know what you're doing.
ADDON_STREAM_CHANNEL_ID
is a channel you wish the bot to publish notifications at. Make sure you've allowed your bot to access and interact with given channel.
ADDON_STREAM_LOOP_TIME
specifies how often (in miliseconds) the bot should check for stream updates. Don't go below 10 seconds, or our proxy will rate-limit your requests.
ADDON_STREAM_ELOCAST_SEO
is seo of the channel you wish to keep track of. https://elocast.com/<SEO>
ADDON_STREAM_USER_ID
is a user that will be tagged, in notifications/messages.
ADDON_STREAM_NOTIFY_*
variables are converted to boolean by default, hence return false
if not configured.
Elocast doesn't supply a discord bot itself, you'll have to create one yourself. To do that, visit https://discord.com/developers/applications
and create a new application. After that, head over to <app_name>/bot
tab and click Add Bot
button. Assuming nothing went wrong, you'll be redirected to your bot's page. You can configure the bot to your liking, but what's actually important right now, is the token
, which can be found below the username
input. Save it to your .env
file, as BOT_TOKEN
variable. Afterwards, head over to <app_name>/OAuth2
tab, under scopes
you'll select option bot
and copy the URL from the input below. Paste the url in your browser and select the server you wish to authorise the bot at.
Now, unless you've already specified them you'll be left with two, missing env variables:
- [
ADDON_STREAM_CHANNEL_ID
] Create atext channel
on your server, or use an existing one. Right click the channel and selectCopy ID
. - [
ADDON_STREAM_USER_ID
] Find a user you wish to be tagged in notifications, and right click on ther avatar/username. SelectCopy ID
option.