From 526cabc6540eac1e8e3cc6d383823d296d0f569c Mon Sep 17 00:00:00 2001 From: TrueXPixells Date: Wed, 16 Nov 2022 09:34:10 +0000 Subject: [PATCH] https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=rest --- app.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 1fea150..7fbfd7e 100644 --- a/app.js +++ b/app.js @@ -1,7 +1,7 @@ const { createInterface } = require('node:readline'); const { execSync } = require('child_process'); const fetch = require('node-fetch'); -const { Client, REST, Routes, GatewayIntentBits } = require('discord.js'); +const { Client, Routes } = require('discord.js'); const client = new Client({ intents: [] }); const rl = createInterface({ input: process.stdin, output: process.stdout }); @@ -30,8 +30,7 @@ const question = (q) => new Promise((resolve) => rl.question(q, resolve)); throw err }); - const rest = new REST({ version: '10' }).setToken(token); - await rest.put(Routes.applicationCommands(client.user.id), { body: [ + await client.rest.put(Routes.applicationCommands(client.user.id), { body: [ { name: 'ping', description: 'yes'