How to self-host Member Counter
(With screenshots!)
Recommendations
Have patience and read carefully this guide
Be familiarized with the CLI (cmd.exe, bash, zsh)
If you need help, feel free to ask in this discord server in #support , but READ THE WHOLE GUIDE FIRST!
Creating a bot account
Go to the Discord Developer Portal, and click "New Application", type a name and click the "Create" button
Now go to the bot tab, and click "Add Bot", and confirm by clicking "Yes, do it!"
Now enable all the privileged gateway intents, change the bot icon if you wish and click "Save Changes", and copy the bot token by clicking "Copy" under the "Token" section, save it in a safe place for future steps
Install docker
Download and install Docker and Docker Compose for your OS
Docker Compose: https://docs.docker.com/compose/install/
After installing docker
and docker-compose
, you should run the following command:
Install git
Download and install git for your OS: https://git-scm.com/download
Install Member Counter
Open your terminal (cmd.exe, Terminal.app, etc) and run this command to download Member Counter
Now open the downloaded directory
Configuring Member Counter
Open the bot folder in your terminal and create a .env
file from the .env.example
file
A new .env
file will appear in the folder, open it with your favorite text editor (like notepad.exe, vim, vscode, etc)
You might have to toggle the hidden files visibility in your file explorer
You will see a bunch of variables to set, but at least, you only need to set one: DISCORD_CLIENT_TOKEN
(in the second line), after the equal character (=
) paste here the bot token, and save the file
Optional configuration
In order to use counters like {youtubeSubscribers}
or {twitterFollowers}
you must set the following variables:
YOUTUBE_API_KEY
Paste here your YouTube API key, you can get it hereTWITCH_CLIENT_ID
andTWITCH_CLIENT_SECRET
Paste here your Twitch app credentials, you can get them hereTWITTER_CONSUMER_KEY
,TWITTER_CONSUMER_SECRET
,TWITTER_ACCESS_TOKEN
,TWITTER_ACCESS_TOKEN_SECRET
Paste here your Twitter API credentials, you can get them here
Start Member Counter
Open again your terminal and use this command
This step will take a long time, be patient
If you see a message like this, that means you successfully installed Member Counter, else, it will give you errors that you must fix (stop the bot with Ctrl+C and check the previous steps)
Invite the bot to your discord server using the provided link, and check commands like @Member Counter help
, @Member Counter status
If the bot is working well, let's make the bot auto start when your PC or server boots up, focus your terminal window and hit Ctrl+C to stop the bot and then run it again in the background with this:
The bot will run in background, to stop it you can use
Updating Member Counter
Open the bot's folder in a terminal, and stop and destroy the bot
Don't worry, all the DB data is stored in ./storage
Download the latest version
Rebuild and start everything again except the bot
Run the bot image, but running the update scripts, not the actual bot
Finally, start the bot
Last updated