</JustTheDev>
</JustTheDev>
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/14/2024 in #djs-questions
Restart every 1 hour
bruh
8 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/21/2024 in #djs-questions
Send me dm on every message
i am doing a social experiment
5 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/21/2024 in #djs-questions
Send me dm on every message
I have 1 server and i want to log every message send there in my dm
5 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/20/2024 in #djs-questions
deploy-commands.js stopped working without errors
yes
19 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/20/2024 in #djs-questions
deploy-commands.js stopped working without errors
Like this?
const data = await rest.put(
Routes.applicationCommands(clientId),
{ body: commands },
);
const data = await rest.put(
Routes.applicationCommands(clientId),
{ body: commands },
);
19 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/20/2024 in #djs-questions
deploy-commands.js stopped working without errors
how does that work?\
19 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/20/2024 in #djs-questions
deploy-commands.js stopped working without errors
and with the delete all commands it was fixed
19 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/20/2024 in #djs-questions
deploy-commands.js stopped working without errors
I used the default deploy commands from the documentation but it created 2 commands for 1 file So it was like i had 2 /ping commands that both did the same
19 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/20/2024 in #djs-questions
Live count cmd
How can i do that?
5 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/20/2024 in #djs-questions
deploy-commands.js stopped working without errors
huh
19 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/20/2024 in #djs-questions
deploy-commands.js stopped working without errors
is same file but message was to big for discord without nitro lol
19 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/20/2024 in #djs-questions
deploy-commands.js stopped working without errors
// Construct and prepare an instance of the REST module
const rest = new REST().setToken(token);

// and deploy your commands!
(async () => {
try {
console.log(`Started refreshing ${commands.length} application (/) commands.`);

// for global commands
rest.put(Routes.applicationCommands(clientId), { body: [] })
.then(() => console.log('Successfully deleted all application commands.'))
.catch(console.error);

// 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);
}
})();
// Construct and prepare an instance of the REST module
const rest = new REST().setToken(token);

// and deploy your commands!
(async () => {
try {
console.log(`Started refreshing ${commands.length} application (/) commands.`);

// for global commands
rest.put(Routes.applicationCommands(clientId), { body: [] })
.then(() => console.log('Successfully deleted all application commands.'))
.catch(console.error);

// 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);
}
})();
19 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/20/2024 in #djs-questions
deploy-commands.js stopped working without errors
const { REST, Routes } = require('discord.js');
const { clientId, token } = require('./config.json');
const fs = require('node:fs');
const path = require('node:path');

const commands = [];
// Grab all the command folders from the commands directory you created earlier
const foldersPath = path.join(__dirname, 'commands');
const commandFolders = fs.readdirSync(foldersPath);

for (const folder of commandFolders) {
// Grab all the command files from the commands directory you created earlier
const commandsPath = path.join(foldersPath, folder);
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
// Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment
for (const file of commandFiles) {
const filePath = path.join(commandsPath, file);
const command = require(filePath);
if ('data' in command && 'execute' in command) {
commands.push(command.data.toJSON());
} else {
console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
}
}
}
const { REST, Routes } = require('discord.js');
const { clientId, token } = require('./config.json');
const fs = require('node:fs');
const path = require('node:path');

const commands = [];
// Grab all the command folders from the commands directory you created earlier
const foldersPath = path.join(__dirname, 'commands');
const commandFolders = fs.readdirSync(foldersPath);

for (const folder of commandFolders) {
// Grab all the command files from the commands directory you created earlier
const commandsPath = path.join(foldersPath, folder);
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
// Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment
for (const file of commandFiles) {
const filePath = path.join(commandsPath, file);
const command = require(filePath);
if ('data' in command && 'execute' in command) {
commands.push(command.data.toJSON());
} else {
console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
}
}
}
19 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/20/2024 in #djs-questions
deploy-commands.js stopped working without errors
1 sec
19 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/14/2024 in #djs-questions
Restart every 1 hour
doesnt matter
8 replies
DIdiscord.js - Imagine ❄
Created by Fauxborisvv on 3/9/2024 in #djs-questions
Im trying to make a discord bot in replit, Please help
how does that work
13 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/6/2024 in #djs-questions
Help me pls
not fully...
12 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/6/2024 in #djs-questions
Help me pls
will it work or not?
12 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/6/2024 in #djs-questions
Help me pls
owh
12 replies
DIdiscord.js - Imagine ❄
Created by </JustTheDev> on 3/6/2024 in #djs-questions
Help me pls
yeah but i dont know what the warning means....
12 replies