Omar
Omar
DIAdiscord.js - Imagine an app
Created by Omar on 9/19/2024 in #djs-questions
kick/ban member in list of servers
thanks for helping!
4 replies
DIAdiscord.js - Imagine an app
Created by Omar on 9/15/2024 in #djs-questions
slash command issue
ty
25 replies
DIAdiscord.js - Imagine an app
Created by Omar on 9/15/2024 in #djs-questions
slash command issue
and what about the user install? sorry for bothering you
25 replies
DIAdiscord.js - Imagine an app
Created by Omar on 9/15/2024 in #djs-questions
slash command issue
No description
25 replies
DIAdiscord.js - Imagine an app
Created by Omar on 9/15/2024 in #djs-questions
slash command issue
i have both enabled and tried in guild
25 replies
DIAdiscord.js - Imagine an app
Created by Omar on 9/15/2024 in #djs-questions
slash command issue
so i have to require the guild id?
25 replies
DIAdiscord.js - Imagine an app
Created by Omar on 9/15/2024 in #djs-questions
slash command issue
No description
25 replies
DIAdiscord.js - Imagine an app
Created by Omar on 9/15/2024 in #djs-questions
slash command issue
i did both :pepehmm:
25 replies
DIAdiscord.js - Imagine an app
Created by Omar on 9/15/2024 in #djs-questions
slash command issue
there is the response
25 replies
DIAdiscord.js - Imagine an app
Created by Omar on 9/15/2024 in #djs-questions
slash command issue
Loading 1 commands from commands\utility [ { id: 'id', application_id: 'id', version: '1284912689256202405', default_member_permissions: null, type: 1, name: 'ping', name_localizations: null, description: 'Replies with Pong!', description_localizations: null, dm_permission: true, contexts: null, integration_types: [ 0 ], nsfw: false } ] Successfully reloaded 1 application (/) commands.
25 replies
DIAdiscord.js - Imagine an app
Created by Omar on 9/15/2024 in #djs-questions
slash command issue
it doesnt
25 replies
DIAdiscord.js - Imagine an app
Created by Omar on 9/15/2024 in #djs-questions
slash command issue
yep i did
25 replies
DIAdiscord.js - Imagine an app
Created by Omar on 9/15/2024 in #djs-questions
slash command issue
thats the command
import { SlashCommandBuilder } from "discord.js";

export default {
data: new SlashCommandBuilder()
.setName("ping")
.setDescription("Replies with Pong!"),

async execute(interaction) {
await interaction.reply("Pong!");
},
};
import { SlashCommandBuilder } from "discord.js";

export default {
data: new SlashCommandBuilder()
.setName("ping")
.setDescription("Replies with Pong!"),

async execute(interaction) {
await interaction.reply("Pong!");
},
};
25 replies
DIAdiscord.js - Imagine an app
Created by Omar on 9/15/2024 in #djs-questions
slash command issue
import { REST, Routes } from 'discord.js';
import fs from 'fs/promises';
import path from 'path';
import dotenv from 'dotenv';

dotenv.config();

const commands = [];

async function getCommands() {
const commandFolders = await fs.readdir('commands');

for (const folder of commandFolders) {
const commandsPath = path.join('commands', folder);
const commandFiles = await fs.readdir(commandsPath);

console.log(`Loading ${commandFiles.length} commands from ${commandsPath}`);

for (const file of commandFiles) {
let command = await import(`./commands/${folder}/${file}`);
command = command.default;

if (command.data && command.execute) {
commands.push(command.data.toJSON());
} else {
console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
}
}
}
}

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

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

await getCommands();

// The put method is used to fully refresh all commands in the guild with the current set
const data = await rest.put(
Routes.applicationCommands(process.env.CLIENT_ID),
{ body: commands }
);

console.log(`Successfully reloaded ${data.length} application (/) commands.`);
} catch (error) {
console.error(error);
}
})();
import { REST, Routes } from 'discord.js';
import fs from 'fs/promises';
import path from 'path';
import dotenv from 'dotenv';

dotenv.config();

const commands = [];

async function getCommands() {
const commandFolders = await fs.readdir('commands');

for (const folder of commandFolders) {
const commandsPath = path.join('commands', folder);
const commandFiles = await fs.readdir(commandsPath);

console.log(`Loading ${commandFiles.length} commands from ${commandsPath}`);

for (const file of commandFiles) {
let command = await import(`./commands/${folder}/${file}`);
command = command.default;

if (command.data && command.execute) {
commands.push(command.data.toJSON());
} else {
console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
}
}
}
}

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

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

await getCommands();

// The put method is used to fully refresh all commands in the guild with the current set
const data = await rest.put(
Routes.applicationCommands(process.env.CLIENT_ID),
{ body: commands }
);

console.log(`Successfully reloaded ${data.length} application (/) commands.`);
} catch (error) {
console.error(error);
}
})();
25 replies
DIAdiscord.js - Imagine an app
Created by Omar on 9/15/2024 in #djs-questions
slash command issue
and still cant use the command
25 replies
DIAdiscord.js - Imagine an app
Created by Omar on 9/15/2024 in #djs-questions
slash command issue
now what, i did it and it succeeded
25 replies
DIAdiscord.js - Imagine an app
Created by Omar on 9/15/2024 in #djs-questions
slash command issue
how do i do that?
25 replies