To set up a test intance of Icarus, here's what you'll need to do:
- This guide assumes you are moderately familiar with Discord bots and the Discord API.
- MongoDB (Version - ^4.0.22)
- Node.js (Version - ^16.13.1)
- Create a Discord bot application. It must have all privileged intents enabled. Note the bot token and applicationId.
- Invite your bot to the official Icarus test server (Talk to Ryndinovia), or your own server. This generator is filled in with the required permissions. Just fill in the applicationId, and the scope field must be
applications.commands bot
. - Clone the repository.
- For each of the files in
registry
, use a script (or Postman) to post those slash commands to the guild the bot is in (not global commands). Explanations on the required APIs for that can be found within Discord docs. Note the ID of every command registered for configuring the bot later. - Create the following files, based on their matching
-example
file:config/config.json
,config/snowflakes.json
,config/rankConfig.json
, anddata/banned.json
.- Explanations of these files can be found below.
- Within the root folder of the repo, run
npm ci
. - The start-up command is
node ./icarus.js
.
For the bot to successfully run, you'll need to create or edit a few files first. These files, for various reasons, are excluded from the repository. However, example files are provided to make their creation easier.
Required items:
api.snipcart
: required to run/bank discount
. Can otherwise be left blank.api.steam
: required to run/bank game list
. Can otherwise be left blank, but will create an error message on loadingbank.js
. An API key can be requested here.db.db
: a connection string used indbModels.js
passed tomongoose.connect()
. See also here.db.settings
: an object used indbModels.js
passed tomongoose.connect()
. See also here.error.url
: the URL of a Discord webhook for posting error messages.google
: information for the Google API. Currently, the only fields accessed arecreds
andsheets.games
, and they are accessed bybank.js
.token
: the bot's token for login.
A test server has been set up here, and a set of snowflakes for channels
and roles
is available there for use.
All ID fields in the example file are required for the bot to be fully functional. Many are required for it to start up at all.
commands
: Snowflakes of any registered application commands.ldsg
: The Discord ID of the bot's home server (such as the test server), provided as a string.ownerId
: The Discord ID of the bot's owner. Used in permission checks for various commands.adminId
: An array of Discord User IDs. Used in permission checks for various commands.
This file is used by rankInfo.js
, which is in turn used by rank.js
. This file will be merged into config.json
and snowflakes.json
later on.
The provided example can be copied without modification.
- Google Sheets config and example for testing
bank.js
. - How to test Snipcart-related functionality if needed?
- Automation of slash command registration.