Skip to content
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

Deploy Discord commands during bot build #198

Merged
merged 7 commits into from
Mar 23, 2022
Merged

Deploy Discord commands during bot build #198

merged 7 commits into from
Mar 23, 2022

Conversation

vcarl
Copy link
Member

@vcarl vcarl commented Mar 22, 2022

I talked with Nick about this a little bit a few weeks ago, #148 looked like it hit a wall due to how weirdly different slash commands are from responding to messages. There's still a larger change we could make for performance reasons if we need it (we won't need it) where we could set up a web server, and configure Discord to emit web hooks for commands instead of using a persistent network connection.

The meat of this change is in scripts/deploy-commands.ts, which fetches the commands and compares the remote list with its local list. This requires that we update the deployment script for every new command we add, but that should be a pretty small amount — command arguments allow us to do most things we are currently, so for example we can do 1 command instead of like 15 for our saved responses.

A follow up task that should probably be done but will work for now is, these are "guild commands", not "global commands". Guild commands update immediately but are presumably worse for performance — I think that because this is a "pet bot" and not used generically in dozens of servers, we won't feel any pain because of that.

@ghost
Copy link

ghost commented Mar 22, 2022

CodeSee Review Map:

Review these changes using an interactive CodeSee Map

Review in an interactive map

View more CodeSee Maps

Legend

CodeSee Map Legend

Base automatically changed from vc-small-fixes to main March 23, 2022 16:40
@vcarl vcarl merged commit ae99527 into main Mar 23, 2022
@vcarl vcarl deleted the vc-deploy-commands branch March 25, 2022 16:55
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.

1 participant