-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get a command working; required demoting builders to 0.7.0 because of…
… issue: discordjs/builders#54
- Loading branch information
1 parent
182485e
commit 1b53b6a
Showing
5 changed files
with
199 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export const config = { | ||
token: process.env.token, | ||
token: process.env.DISCORD_TOKEN, | ||
client: process.env.CLIENT_ID, | ||
guild: process.env.GUILD_ID, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { SlashCommandBuilder } from '@discordjs/builders' | ||
import { REST } from '@discordjs/rest' | ||
import { Routes } from 'discord-api-types/v9' | ||
import { config } from './config.js' | ||
|
||
const commands = [ | ||
new SlashCommandBuilder().setName('ping').setDescription('Reply with pong').toJSON(), | ||
] | ||
|
||
const rest = new REST({ version: '9' }).setToken(config.token) | ||
rest.put(Routes.applicationGuildCommands(config.client, config.guild), { body: commands }) | ||
.then(() => console.log('Hooray! It worked.')) | ||
.catch(console.error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters