Skip to content

Commit b2c2f74

Browse files
committed
fix: use ready client argument instead of harmonix client
1 parent 7458310 commit b2c2f74

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/discord.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@ export const refreshApplicationCommands = async (harmonix: Harmonix) => {
2020
]
2121
const rest = new REST().setToken(process.env.HARMONIX_CLIENT_TOKEN!)
2222

23-
harmonix.client?.once('ready', async () => {
23+
harmonix.client?.once('ready', async (client) => {
2424
try {
2525
consola.info('Started refreshing application commands.')
2626
await rest.put(
27-
Routes.applicationCommands(
28-
harmonix.options.clientId || harmonix.client?.user?.id || ''
29-
),
27+
Routes.applicationCommands(harmonix.options.clientId || client.user.id),
3028
{
3129
body: commands.map((cmd) =>
3230
isHarmonixCommand(cmd) ? slashToJSON(cmd) : contextMenuToJSON(cmd)
@@ -37,7 +35,7 @@ export const refreshApplicationCommands = async (harmonix: Harmonix) => {
3735
const readyEvent = harmonix.events.get('ready')
3836

3937
if (readyEvent) {
40-
ctx.call(harmonix, () => readyEvent.callback(harmonix.client as any))
38+
ctx.call(harmonix, () => readyEvent.callback(client))
4139
}
4240
} catch (error: any) {
4341
createError(error.message)

0 commit comments

Comments
 (0)