Please reference the information below when contributing to this repository.
- Write your commands professionally and clearly.
- Proofread your work before submitting as ready for review.
- Choose user-friendly command names.
- Test your build locally before submitting as ready for review.
Reminder: The main branch is 'staging'
- Fork the repo
- Clone to your local system using your IDE of choice
- Make a new branch from staging and name appropriately (e.g. feat: added ADIRS command, fix: typos fixed in ADIRS)
- Create/edit the command you are working on
- Test your build locally (Instructions below)
- Create a PR to merge your changes into staging
Note: It may be beneficial to create a draft PR while working on your command. This will allow us to see who is working on what, and will enable the community to give active feedback on your work.
You can find the pull request template here.
- Install node, npm is bundled with the download
- Open a command prompt in your repo directory and run 'npm install'.
- Log into the Discord website and navigate to the applications page
- Click
New Application
- Give your application a name
- Navigate to the
Bot
tab and clickAdd Bot
. You will have to confirm by clickingYes, do it!
- Click the
Copy
button underneath token. (Do not share this) - Create a file called
.env
in your bot repo - Inside the .env file, type
BOT_SECRET=TOKEN
replacing TOKEN with what you copied in step 6 - You may need to add the .env file to your gitignore if your IDE hasn't done it automatically.
- Create a Discord server where you can test your bot
- On the applications page, navigate to the
OAuth2
tab. Then selectbot
under thescopes
section - Tick
Administrator
under theBot Permissions
section - Click the
Copy
button and paste it into your browser of choice, invite it to your test server.
- Open a command prompt in your repo directory
- Run
npm run dev
- If all has gone well, you will see the bot is running as
http://localhost:3000
and logged into the name of the bot you created! - You can now test your commands
Please note, this will only show the basics of adding a command
- Create a new file in the relevant folder within
src/commands/
and name it appropriately.yourcommand.ts
- Create your command
- Add it to
src/commands/index.ts
. You need to add the lineimport { name } from './commandfolder/fileame';
, replacingname
with theexport const
from your command,commandfolder
with the relevant folder your command has been placed within, andfilename
with the file name you created in step 1. (Add this below the last command.) - Add your command name to the list under
const commands: CommandDefinition[] = [
If you need help creating a command, you may find it useful to copy an existing command as a template, changing what you need.
All you need to do is open the command you wish to edit in src/commands/
, edit what you need, commit and push!
import { CommandDefinition } from '../../lib/command';
import { makeEmbed, makeLines } from '../../lib/embed';
import { CommandCategory } from '../../constants';
const ADIRS_IMAGE_URL = 'https://media.discordapp.net/attachments/785976111875751956/818095298538504272/image0.png';
export const adirs: CommandDefinition = {
name: 'adirs',
description: 'Display help with ADIRS alignment',
category: CommandCategory.FBW,
executor: (msg) => msg.channel.send(makeEmbed({
title: 'FlyByWire A32NX | ADIRS align',
description: makeLines([
'On the overhead panel you will see the three switches under \'ADIRS\'. Turn these three to the \'NAV\' position. It takes several minutes for the ADIRUs to align.',
'You can check how long you have to wait by looking at the align time on your Upper Ecam.',
]),
image: { url: ADIRS_IMAGE_URL },
})),
};