Skip to content

Conversation

@psionikangel
Copy link

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 jeremie.carpentier.roy@gmail.com

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 <jeremie.carpentier.roy@gmail.com>
.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 ////////
Copy link
Owner

@feydan feydan Jan 7, 2022

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?

Copy link
Author

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.

Copy link
Collaborator

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)
Copy link
Owner

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants