A Discord bot with a web dashboard
A welcome and log bot you configure on a web page behind Discord login, and the example to copy when your own bot needs one.
Changes take effect straight away.
{user} mentions them · {username} their name · {server} this server · {count} how many members there are now
- Plan
- Starter, $2: stays awake
- Setup
- Token, client ID and secret
- Privileged intents
- Server Members, Message Content
- Code
- About 400 lines, with tests
What the dashboard bot does
Welcomes new members
In a channel you pick, with their name, your server's name and the member count.
Logs the server
Joins, leaves, edited and deleted messages in another channel.
Set up on a web page
Sign in with Discord at the bot's own address, pick channels from a list and write the welcome. Only owners, administrators and people with Manage Server get in.
An example to copy
The Discord login, the permission check and the settings file, tested, in about four hundred lines. Copy them into your own bot.
Set it up
- 1
Create the application
At discord.com/developers. Under Bot, Reset Token and copy it, and under Privileged Gateway Intents turn on Server Members and Message Content.
- 2
Copy the OAuth2 details
On the OAuth2 page of the same application: the Client ID and the Client Secret.
- 3
Deploy it
Press Deploy free, pick Bot with a dashboard and paste the token, the two OAuth2 values and any long random string as the session secret. Its web address is turned on for you.
- 4
Add the redirect
Open the address once. The console prints the redirect URL to add under OAuth2, Redirects: your address with
/auth/callbackon the end. Discord sends nobody back to an address it does not know. - 5
Invite it and sign in
Invite the bot to your server, sign in on the dashboard and pick your channels.
On the dashboard
- Welcome channel
- Where new members are greeted, or Off.
- Welcome message
- Up to 1,500 characters. {user} mentions them, {username} is their name, {server} your server and {count} the member count.
- Log channel
- Where joins, leaves, edited and deleted messages go, or Off.
A server shows up on the dashboard when you own it, are an administrator or have Manage Server there, and the bot is in it.
Environment variables
They live in the table on the bot's page in the panel, values masked once saved. The template's form asks for the ones it needs when you deploy.
| Variable | Needed | What it is |
|---|---|---|
| DISCORD_TOKEN | Required | The bot token, from Bot, Reset Token. |
| DISCORD_CLIENT_ID | Required | From the OAuth2 page of the same application. |
| DISCORD_CLIENT_SECRET | Required | From the OAuth2 page. Treat it like a password. |
| SESSION_SECRET | Required | Any long random string. It signs the login cookie. |
| APP_URL | Set for you | The public address, set when the web address is on. |
| PORT | Set for you | The port the dashboard listens on. |
Which plan it needs
Starter. A free app with a web address sleeps when nobody has opened it for a while, and a sleeping bot welcomes nobody. On Starter the address and the bot stay awake.
Free
$0
No card
- 256 MB and a quarter of a CPU
- Sleeps when nobody opens the dashboard, and the bot sleeps with it
- Fine for trying it out
Starter
Recommended$2/mo
or $20 a year
- The bot and its dashboard always awake
- 1 GB of memory and a full vCPU
- A MySQL database included, for when you build on it
Running more than one? Standard carries two bots or apps for $3 a month and Pro four for $6, on one bill with your game servers. Every plan
Frequently asked questions
Why Starter and not the free plan?
It runs on the free plan, but a free app with a web address sleeps when nobody opens the address for a while, from 5 minutes to 12 hours, and the bot sleeps with it. Starter keeps both awake for $2 a month or $20 a year.
Who can change the settings?
Someone who owns the server, is an administrator or has Manage Server there, and only in servers the bot is in. Every save is checked again against that list, so a hand-written request cannot reach a server that is not theirs.
Where are the settings kept?
In /data/settings.json, one entry per server, on the volume that survives a redeploy. Logins live in memory, so a restart signs everyone out and nothing worth stealing sits on disk.
Can my own bot have a dashboard like this?
That is what it is for. The login, the permission check and the settings file are each a short file in the repository, tested without a Discord token. Fork it, or copy the parts into your bot.
More ready-made bots
Bringing your own code instead? How a bot deploys from GitHub
Give your bot a dashboard
Your first bot is free, with no card. It logs in within a minute.