From 891cf0ecdad9a1a78fdf5d127a60bdcc8e54ae5c Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Thu, 15 Feb 2024 20:19:36 -0500 Subject: Deploy command changes; Filter bots on vote; Fixed status --- deploy-command.js | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'deploy-command.js') diff --git a/deploy-command.js b/deploy-command.js index fd9de7a..0b57507 100644 --- a/deploy-command.js +++ b/deploy-command.js @@ -1,6 +1,5 @@ import fs, { readFileSync } from 'node:fs'; -import { REST } from '@discordjs/rest'; -import { Routes } from 'discord-api-types/v10'; +import { REST, Routes } from 'discord.js'; // import config from './config.json' assert {type: 'json'} const { clientID, token } = JSON.parse(readFileSync('./config.json')); @@ -12,8 +11,22 @@ for (const file of commandFiles) { commands.push(command.data.toJSON()); } -const rest = new REST({ version: '10' }).setToken(token); +const rest = new REST().setToken(token); -rest.put(Routes.applicationCommands(clientID), { body: commands }) - .then(() => console.log('Successfully registered application commands.')) - .catch(console.error); +// and deploy your commands! +(async() => { + try { + console.log(`Started refreshing ${commands.length} application (/) commands.`); + + // The put method is used to fully refresh all commands in the guild with the current set + const data = await rest.put( + Routes.applicationCommands(clientID), + { body: commands } + ); + + console.log(`Successfully reloaded ${data.length} application (/) commands.`); + } catch (error) { + // And of course, make sure you catch and log any errors! + console.error(error); + } +})(); -- cgit v1.2.3 From d7b0c0f3b7129cf3beaaa66bbb6d64bdd35deb78 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Thu, 15 Feb 2024 20:27:52 -0500 Subject: Remove unneeded packages; Parlance config; Changes in about --- .parlance.json | 11 +++++++++++ Commands/about.js | 2 +- deploy-command.js | 1 - package.json | 2 -- yarn.lock | 7 +------ 5 files changed, 13 insertions(+), 10 deletions(-) (limited to 'deploy-command.js') diff --git a/.parlance.json b/.parlance.json index e69de29..d25db98 100644 --- a/.parlance.json +++ b/.parlance.json @@ -0,0 +1,11 @@ +{ + "name": "Discord Local Audio Player", + "subprojects": [ + { + "name": "DLAP Bot", + "type": "i18next", + "path": "/Locales/{lang}/translation.json", + "baseLang": "en" + } + ] +} diff --git a/Commands/about.js b/Commands/about.js index 8e1d31d..d74a9e9 100644 --- a/Commands/about.js +++ b/Commands/about.js @@ -38,7 +38,7 @@ export default { { name: t('aboutCreator'), value: 'Andrew Lee (alee)' }, // Do not remove this since I created this :) { name: t('aboutContributors'), value: 'Victor Moraes (Vicktor#7232) (Improving README)' }, // { name: t('aboutForked'), value: '[your name] (username)' }, - { name: t('aboutFrameworks'), value: `Discord.JS ${version}\nmusic-metadata` }, + { name: t('aboutFrameworks'), value: `Discord.JS ${version}\nmusic-metadata\ni18next` }, { name: t('aboutLicense'), value: 'GNU General Public License v3.0' } ) .setFooter({ text: '© Copyright 2020-2024 Andrew Lee' }) diff --git a/deploy-command.js b/deploy-command.js index 0b57507..f464825 100644 --- a/deploy-command.js +++ b/deploy-command.js @@ -1,6 +1,5 @@ import fs, { readFileSync } from 'node:fs'; import { REST, Routes } from 'discord.js'; -// import config from './config.json' assert {type: 'json'} const { clientID, token } = JSON.parse(readFileSync('./config.json')); const commands = []; diff --git a/package.json b/package.json index 921d07e..4c309cb 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,7 @@ }, "dependencies": { "@discordjs/opus": "^0.9.0", - "@discordjs/rest": "^2.2.0", "@discordjs/voice": "^0.16.1", - "discord-api-types": "^0.37.69", "discord.js": "^14.14.1", "ffmpeg-static": "^5.2.0", "i18next": "^23.8.2", diff --git a/yarn.lock b/yarn.lock index 7e3a0e1..664b8df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -72,7 +72,7 @@ "@discordjs/node-pre-gyp" "^0.4.5" node-addon-api "^5.0.0" -"@discordjs/rest@^2.1.0", "@discordjs/rest@^2.2.0": +"@discordjs/rest@^2.1.0": version "2.2.0" resolved "https://registry.yarnpkg.com/@discordjs/rest/-/rest-2.2.0.tgz#f4ec00d3faff965c00a879b7e87bb4b6f4446966" integrity sha512-nXm9wT8oqrYFRMEqTXQx9DUTeEtXUDMmnUKIhZn6O2EeDY9VCdwj23XCPq7fkqMPKdF7ldAfeVKyxxFdbZl59A== @@ -534,11 +534,6 @@ discord-api-types@0.37.61: resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.37.61.tgz#9dd8e58c624237e6f1b23be2d29579af268b8c5b" integrity sha512-o/dXNFfhBpYHpQFdT6FWzeO7pKc838QeeZ9d91CfVAtpr5XLK4B/zYxQbYgPdoMiTDvJfzcsLW5naXgmHGDNXw== -discord-api-types@^0.37.69: - version "0.37.69" - resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.37.69.tgz#4c78a03ef247dd8d6b95e4eaf199ed8d000a3955" - integrity sha512-c0rHc5YGNIXQkI+V7QwP8y77wxo74ITNeZmMwxtKC/l01aIF/gKBG/U2MKhUt2iaeRH9XwAt9PT3AI9JQVvKVA== - discord.js@^14.14.1: version "14.14.1" resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-14.14.1.tgz#9a2bea23bba13819705ab87612837610abce9ee3" -- cgit v1.2.3