镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Deploy Discord commands during bot build - #198

Merged
vcarl merged 7 commits into
mainfrom
vc-deploy-commands
Mar 23, 2022
Merged

vcarl merged 7 commits into
mainfrom
vc-deploy-commands

Conversation

@vcarl

@vcarl vcarl commented Mar 22, 2022

Copy link
Copy Markdown
Member

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

ghost commented Mar 22, 2022 •

Copy link
Copy Markdown

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 force-pushed the vc-deploy-commands branch from ee7c1a7 to af79331 Compare March 23, 2022 17:35
@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