-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds the barebone code necessary to get a Discord bot running #1
base: main
Are you sure you want to change the base?
Conversation
These files will allow a very basic Discord bot to run and answer to </slash commands> in a discord server to accomplish basic tasks (such as answering questions and starting a Satisfactory Dedicated Server) Signed-off-by: Jérémie Carpentier-Roy <[email protected]>
.setDescription('Start the satisfactory server!'), | ||
async execute(interaction) { | ||
await interaction.reply("Sending message to start Satisfactory Server!"); | ||
///////// Your code to start the Satisfactory Server here //////// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is in the repo that contains a way to start the server by hitting an http endpoint, I wonder if it would be good to have a config.ts setting for the lambda/api gateway url -- then this command could just hit that url with an http client to start the server. Maybe have it as an optional implementation if the config is set for the start url. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I'm using GCP I removed all of my GCP-related code such as the centralised GCP config (And also because I use PubSub as the trigger for my GCP Cloud Functions so that's extra layer I have to deal with) from this file as this would have been pretty useless in your case since your whole setup is on AWS.
But you are correct that config should be centralised for easier access.
And in your particular case and having this command hit the URL is probably the simplest way to make it work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a small hiccup with this step. It's that the api url is generated after the resources have been deployed and the deployment does not affect local files. The deployment can output the api url once the deployment has completed and the user can then copy this value into the config file.
You will need: | ||
|
||
* A discord account | ||
* A discord server that you manage (meaning you can add apps and bots to it) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't have to be part of this MR, but it would be nice as a future feature to integrate the creation of the micro instance that manages the bot into the cdk code. Eventually we could have a config variable boolean that could control whether you want the discord bot to be provisioned and deployed along with the other services. (this is just a note, nothing actionable here)
These files will allow a very basic Discord bot to run and answer
to </slash commands> in a discord server to accomplish basic tasks (such
as answering questions and starting a Satisfactory Dedicated Server)
Signed-off-by: Jérémie Carpentier-Roy [email protected]