- Node.js 17.3 or newer
- A Discord application and bot token from the Discord Developer Portal
-
Clone the repository and enter its directory:
git clone https://github.com/utgwiki/derik.git cd derik -
Install the dependencies:
npm install
-
Create your environment file from the example:
cp .env.example .env
-
Open
.envand replaceyour_discord_token_herewith the bot token from the Discord Developer Portal. The web server uses port3000by default; setPORTto a different value if needed. -
Start the bot:
npm start
Most bot behavior is configured in config.js. Restart the bot after making changes.
WIKIS— Define the wikis supported by the bot. Each entry contains the wiki name, MediaWiki API endpoint, article URL, message prefix, and emoji.WIKI_MAP— Map Discord channel or category IDs to a wiki. This controls which wiki is used when a message does not include a wiki prefix.STATUS_OPTIONS— Customize the bot’s rotating Discord status messages and activity types.STATUS_INTERVAL_MS— Set how often the bot rotates its status. The default is five minutes.COMMANDS— Enable or disable individual slash commands. Set a command tofalseto prevent it from being registered with Discord. Available commands arespeedrun,contribs,wiki,parse,user, andrandom.SPEEDRUN_EMOJIandCONTRIBSCORES_SCORE_EMOJI— Set the custom emoji IDs used by those features.
When adding a wiki, add its configuration to WIKIS and update WIKI_MAP or the relevant status messages as needed. Discord channel, category, and emoji IDs can be copied using Discord’s Developer Mode.
bot/server.js starts a small web server so Instatus can check whether the bot is active. It listens on 0.0.0.0 and uses the PORT value from .env (or port 3000 when it is unset). The file is part of the bot’s normal startup through index.js; it can be removed if Instatus monitoring is not needed, provided the corresponding require("./bot/server") line is also removed from index.js.
