- 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.PAGE_CACHE_MS— Set how long page lookups stay cached in memory. The default is 30 minutes.COMMANDS— Enable or disable individual slash commands. Set a command tofalseto prevent it from being registered with Discord. Available slash commands arespeedrun,contribs,wiki,parse,user,random, andcosmetic;trackercontrols the background Roblox tracker.SPEEDRUN_EMOJIandCONTRIBSCORES_SCORE_EMOJI— Set the custom emoji IDs used by those features.TRACKER— Configure the Roblox tracker. SetroleIdto the role that should be pinged,distributionto map Discord channel IDs to one or more Roblox universe IDs (not place IDs), andfrequencyto the visit milestone interval.intervalMscontrols how often Roblox is checked and defaults to three minutes.
The tracker announces visit milestones, game updates, and newly added subplaces. It stores its last-seen values in tracker/visitchecker.json. Set COMMANDS.tracker to false to disable all tracker checks and role pings; the tracker will not start at all in that mode.
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.
