DCS-Promo-bot sends a message to discord if a pilot becomes eligible for promotion. It checks a google sheets document for edits and if an edit it made and a pilot on that row is eligible for promotion, a message is pushed to discord.
These are the instructions to install the DCS-Promo-bot in a Google Spreadsheet.
The Discord WebHook is what enable the script to send the information to Discord To create the WebHook:
- Open the
Discord Server Settings -> Integrations -> Create Webhook - Name the Webhook whatever you like, and give it a channel where it will post
- NOTE: The channel and name can be changed whenever you like
- Next hit the copy WebHook URL button to copy the WebHook
- Now move on to adding the script to the Spreadsheet
In order to add the script to the spreadsheet, you must:
- Click on the sheet you want the script to execute in
- Go to
Extensions -> Apps Script - Add a file and name it
main.gs - Paste the code from the
main.gsin this repository into that file - Paste the WebHook URL you copied into the
POST_URLvariable in the script inside the quotation marks, but make sure to remove the<> - Save, and now move on to creating triggers
There are two triggers that must be created in order for the code to run. The first trigger is for when you open the spreadsheet. This trigger is know as the onOpen trigger and as the name suggests executes when the spreadsheet is opened. In this script it's purpose is to get all the current statuses of the pilots such that you have a history to compare your new eligibility information to. The second trigger is the onEdit trigger which activites whenever a edit has been made and is what sends a message to discord via the webhook.
Therefore to create the Triggers, inside the Apps Script page:
- Go to Triggers page on the left hand side
- Select Add Trigger
- Set the function to run as
process_eligibility, the deployment tohead, event sourcefrom spreadsheet, event type ason edit, and the failure notification to your preference - Then hit save
- Then create another trigger with the settings as
on_sheet_openfor the function, deployment ashead, event source asfrom spreadsheet, event type ason Open, and again the failure notification to your preference - Then hit save
- And that is everything set!
0.0.1 - Initial Release