Jereme
Jereme
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
what
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
oh and
0.options[0][UNION_TYPE_CHOICES]: Value of field "type" must be one of (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11).
0.options[1][UNION_TYPE_CHOICES]: Value of field "type" must be one of (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11).
0.options[2][UNION_TYPE_CHOICES]: Value of field "type" must be one of (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11).
at handleErrors (C:\Users\dolph\Downloads\SkyFade\node_modules\@discordjs\rest\dist\index.js:730:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (C:\Users\dolph\Downloads\SkyFade\node_modules\@discordjs\rest\dist\index.js:1133:23)
at async SequentialHandler.queueRequest (C:\Users\dolph\Downloads\SkyFade\node_modules\@discordjs\rest\dist\index.js:963:14)
at async _REST.request (C:\Users\dolph\Downloads\SkyFade\node_modules\@discordjs\rest\dist\index.js:1278:22)
at async GuildApplicationCommandManager.set (C:\Users\dolph\Downloads\SkyFade\node_modules\discord.js\src\managers\ApplicationCommandManager.js:171:18) {
requestBody: { files: undefined, json: [ [Object], [Object] ] },
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: { '0': [Object] }
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/1254637442628321361/guilds/1254264050658054204/commands'
}
0.options[0][UNION_TYPE_CHOICES]: Value of field "type" must be one of (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11).
0.options[1][UNION_TYPE_CHOICES]: Value of field "type" must be one of (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11).
0.options[2][UNION_TYPE_CHOICES]: Value of field "type" must be one of (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11).
at handleErrors (C:\Users\dolph\Downloads\SkyFade\node_modules\@discordjs\rest\dist\index.js:730:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (C:\Users\dolph\Downloads\SkyFade\node_modules\@discordjs\rest\dist\index.js:1133:23)
at async SequentialHandler.queueRequest (C:\Users\dolph\Downloads\SkyFade\node_modules\@discordjs\rest\dist\index.js:963:14)
at async _REST.request (C:\Users\dolph\Downloads\SkyFade\node_modules\@discordjs\rest\dist\index.js:1278:22)
at async GuildApplicationCommandManager.set (C:\Users\dolph\Downloads\SkyFade\node_modules\discord.js\src\managers\ApplicationCommandManager.js:171:18) {
requestBody: { files: undefined, json: [ [Object], [Object] ] },
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: { '0': [Object] }
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/1254637442628321361/guilds/1254264050658054204/commands'
}
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const fs = require('fs');
require('dotenv').config();

const commands = [];
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));

for (const file of commandFiles) {
const command = require(`./commands/${file}`);
commands.push(command.data.toJSON());
}

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

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

await rest.put(
Routes.applicationCommands(process.env.CLIENT_ID), // Replace CLIENT_ID with your bot's client ID
{ body: commands },
);

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');
require('dotenv').config();

const commands = [];
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));

for (const file of commandFiles) {
const command = require(`./commands/${file}`);
commands.push(command.data.toJSON());
}

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

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

await rest.put(
Routes.applicationCommands(process.env.CLIENT_ID), // Replace CLIENT_ID with your bot's client ID
{ body: commands },
);

console.log('Successfully reloaded application (/) commands.');
} catch (error) {
console.error(error);
}
})();
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
client.commands = new Map();

const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
}
client.commands = new Map();

const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
}
client.guilds.cache.get(guildId)?.commands.set(Array.from(client.commands.values())).then(() => {
console.log('Slash commands registered!');
}).catch(console.error);
});

client.on('interactionCreate', async interaction => {
if (!interaction.isCommand()) return;

const { commandName } = interaction;

if (!client.commands.has(commandName)) return;

try {
await client.commands.get(commandName).execute(interaction);
} catch (error) {
console.error(error);
await interaction.reply({ content: 'There was an error executing this command.', ephemeral: true });
}
});
client.guilds.cache.get(guildId)?.commands.set(Array.from(client.commands.values())).then(() => {
console.log('Slash commands registered!');
}).catch(console.error);
});

client.on('interactionCreate', async interaction => {
if (!interaction.isCommand()) return;

const { commandName } = interaction;

if (!client.commands.has(commandName)) return;

try {
await client.commands.get(commandName).execute(interaction);
} catch (error) {
console.error(error);
await interaction.reply({ content: 'There was an error executing this command.', ephemeral: true });
}
});
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
huh
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
bc im dumb
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
or
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
wait did i do it right
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
both
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
string
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
sorry but im new to v14 and stuff
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
this
const { EmbedBuilder } = require('discord.js');

module.exports = {
name: 'embedcreate',
description: 'Creates a customizable embed message',
options: [
{
name: 'title',
type: 'STRING',
description: 'Title of the embed',
required: true,
},
{
name: 'description',
type: 'STRING',
description: 'Description of the embed',
required: true,
},
{
name: 'image',
type: 'STRING',
description: 'URL of the image for the embed',
required: false,
},
],
execute(interaction) {
const { options } = interaction;

const title = options.getString('title');
const description = options.getString('description');
const imageUrl = options.getString('image');

const embed = new EmbedBuilder()
.setColor('#0096ff')
.setTitle(title)
.setDescription(description)
.setTimestamp();

if (imageUrl) {
embed.setImage(imageUrl);
}

embed.setFooter('Powerd By SkyFade');

interaction.reply({ embeds: [embed], ephemeral: true });
},
};
const { EmbedBuilder } = require('discord.js');

module.exports = {
name: 'embedcreate',
description: 'Creates a customizable embed message',
options: [
{
name: 'title',
type: 'STRING',
description: 'Title of the embed',
required: true,
},
{
name: 'description',
type: 'STRING',
description: 'Description of the embed',
required: true,
},
{
name: 'image',
type: 'STRING',
description: 'URL of the image for the embed',
required: false,
},
],
execute(interaction) {
const { options } = interaction;

const title = options.getString('title');
const description = options.getString('description');
const imageUrl = options.getString('image');

const embed = new EmbedBuilder()
.setColor('#0096ff')
.setTitle(title)
.setDescription(description)
.setTimestamp();

if (imageUrl) {
embed.setImage(imageUrl);
}

embed.setFooter('Powerd By SkyFade');

interaction.reply({ embeds: [embed], ephemeral: true });
},
};
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
ii cant find how the embed thing im making is made
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
as of what it is to do what im doing
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
i can find it
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
im on the one you give im using some stuff from my old bot from v13
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
oh dam
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
no fo it to work do i have to export it
101 replies
DIAdiscord.js - Imagine an app
Created by Jereme on 6/25/2024 in #djs-questions
Hello sorry im new to this but did i do this right
wait do i have to export it
101 replies