Add scripts or event hooks to the /scripts/
folder. These should export an
object with two keys:
trigger
, which is the Event that triggers the script.execute
, which is a function that takes in aclient
and returns a event handler function. For a barebones example of this, check out logged-in.js.
Add cron jobs to the /cron/
folder. These should export the following keys:
schedule
, which is a cron-formatted string.timezone
, which is the english-named timezone likeAmerica/New_York
.execute
, which is a function that takes in aclient
and returns a function to be run on a cron schedule.
- Create your own bot using the the discord developer portal.
- Make sure your bot has the proper server authorizations.
- Create a server, invite the bot to it, and give it a good permissions.
- Clone this repo, and set the following environment variables below. I recommend direnv to manage this.
- Navigate to this directory.
$ npm ci
$ node index.js
- You should be greeted with something that looks like:
Logged in as BotUser#123!
Successfully registered application commands.
TOKEN
: The token for the discord bot from the discord API.ROLE
: The role-id for threads registration.GUILD
: The id of the server. Any link to a discord message has the following structure: https://discord.com/channels/GUID_ID/CHANNEL_ID/MESSAGE_ID.