Set up an entire Discord server from a configuration file.
# Use npm… $ npm i -g create-discord-server # …or Yarn $ yarn global add create-discord-server # …or npx (for one-off uses) $ npx create-discord-server [options]Usage: create-discord-server [options] Set up an entire Discord server from a configuration file. Options: -V, --version output the version number -f, --file <name> File containing server configuration -i, --server-id <id> ID of the server to set up -t, --token <string> Token to use when connecting to Discord API -h, --help output usage informationBelow is a detailed description of all the configurations that can be set. If a key isn't used, it can be omitted.
afkTimeout(number): Move user into AFK after x seconds (60, 300, 900, 1800, 3600)explicitContentFilter(number): The level of the explicit content filter (0-2)icon(string): Filepath of the server iconname(string): Name of the serverregion(string): Region of the serversplash(string): Filepath of the server splashverificationLevel(number): The level of security in the server (0-4)
Each value needs to be a channel name (string) or an object that follows the below structure:
name(string): Name of the channeloverwrites(array): Permission overwritesreason(string): Why this channel existstype(string): Type of channel (category, text, voice)
Each value needs to be an object following the below structure:
image(string): Filepath of the emojiname(string): Name of the emojireason(string): Why this emoji existsroles(array): Roles to limit the emoji to
Each value needs to be a role name (string) or an object that follows the below structure:
color(string): Hex color of the rolehoist(boolean): If this role is pinned in the user listingmentionable(boolean): If the role can be mentionedname(string): Name of the rolepermissions(array): Permissions of the roleposition(number): Position of this role
You can also refer to the example config to get an idea of how to set up your config.
- Go to https://discordapp.com/developers/applications/ and click on
Create an application. - After the application is created, click on
Settings > Botand you will find the token under the Build-A-Bot section. This will be used for thetokensetting.
create-discord-server sets up your server through Discord's API, which is accessible through a Discord bot. The following guide will walk you through how to add it to your server: https://github.com/jagrosh/MusicBot/wiki/Adding-Your-Bot-To-Your-Server
Initially, the bot will only have the permissions of a regular user. You will need to grant the bot additional permissions via a custom role. The Discord team has written instructions on how to do so here: https://support.discordapp.com/hc/en-us/articles/206029707-How-do-I-set-up-Permissions-. Give the bot permissions based on your use case (e.g. setting up channels = grant permission to manage channels).
After all of the above has been completed, run create-discord-server with your token and server ID, and you're finished!