Cristiano®
Cristiano®
DIAdiscord.js - Imagine an app
Created by Cristiano® on 12/28/2024 in #djs-questions
Updating commands once the bot is started.
So how should I solve the problem?
25 replies
DIAdiscord.js - Imagine an app
Created by Cristiano® on 12/28/2024 in #djs-questions
Updating commands once the bot is started.
Do you mean this?
25 replies
DIAdiscord.js - Imagine an app
Created by Cristiano® on 12/28/2024 in #djs-questions
Updating commands once the bot is started.
const { REST } = require("@discordjs/rest");
const { Routes } = require('discord-api-types/v9');
const fs = require('fs');

const clientId = '1321817952462573639';
const guildId = '563099392371064833';

module.exports = (client) => {
client.handleCommands = async (commandFolders, path) => {
client.commandArray = [];
for (folder of commandFolders) {
const commandFiles = fs.readdirSync(`${path}/${folder}`).filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`../commands/${folder}/${file}`);
client.commands.set(command.data.name, command);
client.commandArray.push(command.data.toJSON());
}
}

const rest = new REST({
version: '9'
}).setToken(process.env.token);

(async () => {
try {
console.log('Started refreshing application (/) commands.');

await rest.put(
Routes.applicationCommands(clientId), {
body: client.commandArray
},
);

console.log('Successfully reloaded application (/) commands.');
} catch (error) {
console.error(error);
}
})();
};
};
const { REST } = require("@discordjs/rest");
const { Routes } = require('discord-api-types/v9');
const fs = require('fs');

const clientId = '1321817952462573639';
const guildId = '563099392371064833';

module.exports = (client) => {
client.handleCommands = async (commandFolders, path) => {
client.commandArray = [];
for (folder of commandFolders) {
const commandFiles = fs.readdirSync(`${path}/${folder}`).filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`../commands/${folder}/${file}`);
client.commands.set(command.data.name, command);
client.commandArray.push(command.data.toJSON());
}
}

const rest = new REST({
version: '9'
}).setToken(process.env.token);

(async () => {
try {
console.log('Started refreshing application (/) commands.');

await rest.put(
Routes.applicationCommands(clientId), {
body: client.commandArray
},
);

console.log('Successfully reloaded application (/) commands.');
} catch (error) {
console.error(error);
}
})();
};
};
25 replies
DIAdiscord.js - Imagine an app
Created by Cristiano® on 12/28/2024 in #djs-questions
Updating commands once the bot is started.
But why do the other commands work? Always slash.
25 replies
DIAdiscord.js - Imagine an app
Created by Cristiano® on 12/28/2024 in #djs-questions
Updating commands once the bot is started.
No description
25 replies
DIAdiscord.js - Imagine an app
Created by Cristiano® on 12/28/2024 in #djs-questions
Updating commands once the bot is started.
Yes.
25 replies
DIAdiscord.js - Imagine an app
Created by Cristiano® on 12/28/2024 in #djs-questions
Updating commands once the bot is started.
Yes but nothing.
25 replies
DIAdiscord.js - Imagine an app
Created by Cristiano® on 4/29/2023 in #djs-questions
Discord emoji question.
Now work, thank you.
10 replies
DIAdiscord.js - Imagine an app
Created by Cristiano® on 4/29/2023 in #djs-questions
Discord emoji question.
Why?
10 replies
DIAdiscord.js - Imagine an app
Created by Cristiano® on 4/29/2023 in #djs-questions
Discord emoji question.
10 replies
DIAdiscord.js - Imagine an app
Created by Cristiano® on 4/29/2023 in #djs-questions
Discord emoji question.
But when i do commands
10 replies
DIAdiscord.js - Imagine an app
Created by Cristiano® on 4/29/2023 in #djs-questions
Discord emoji question.
10 replies
DIAdiscord.js - Imagine an app
Created by Cristiano® on 4/29/2023 in #djs-questions
Discord emoji question.
.setTitle(" :aa: Nuova comunicazione inoltrata")
.setTitle(" :aa: Nuova comunicazione inoltrata")
10 replies
DIAdiscord.js - Imagine an app
Created by Cristiano® on 4/11/2023 in #djs-questions
Ping outside embed
Working, thank you so much.
12 replies
DIAdiscord.js - Imagine an app
Created by Cristiano® on 4/11/2023 in #djs-questions
Ping outside embed
Thank you.
12 replies
DIAdiscord.js - Imagine an app
Created by Cristiano® on 4/11/2023 in #djs-questions
Ping outside embed
Example
12 replies
DIAdiscord.js - Imagine an app
Created by Cristiano® on 4/11/2023 in #djs-questions
Ping outside embed
One last thing, on .setDescription how can I add what on discord we normally do with ` ? because if I enter `` it doesn't work.
12 replies
DIAdiscord.js - Imagine an app
Created by Cristiano® on 4/11/2023 in #djs-questions
Ping outside embed
12 replies