Basically, this is a bot to turn on/off EC2 instances and check their statuses. Very much WIP. This bot is coded for a single bot to be controlled per Discord server, but I'm sure you could figure out how to change that.
- Create a bot on the Discord developer dashboard.
- clone this
- npm install
- create
.envfile as follows:
AWS_ACCESS_KEY_ID: the access key for the IAM role which will control the servers. Have a look here:AWS_REGION: your instance('s) region(s)AWS_SECRET_ACCESS_KEY: The SECRET access key for your IAM role (see above linkCLIENT_ID: The client ID of your API appGUILD_IDS: a comma separated list of Discord Server Guild IDs that correspond to the instance IDs that follow...INSTANCE_IDS: ...here! There needs to be a 1 to 1 relationship between guild IDs and instance IDs, or else this bot will flop.TOKEN: your Discord bot client token. Terribly named.
To start, run the bot with npm start and presto: the bot should show up!
Run /start-server to start up the instance.
Run /check-server to check whether or not an instance is online. Note that instances take a while to appear OFFLINE after being shut down.
Enjoy!