shullex
shullex
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by shullex on 8/28/2023 in #djs-questions
discord.Colors class question
Hello , kinda interested how should i go about this code :
.addStringOption((option) => option.setName("eventPlayerRoleColor").setDescription("Set Color for players in the event.").setChoices())
.addStringOption((option) => option.setName("eventPlayerRoleColor").setDescription("Set Color for players in the event.").setChoices())
How could i create setChoices with all colors inside discord.Colors class so i could get them all in my choices?
56 replies
DIAdiscord.js - Imagine an app
Created by shullex on 8/27/2023 in #djs-questions
nsupportedCacheOverwriteWarning
got this error stack on fresh ts project , anyone could tell me whats wrong ?
(node:1604) UnsupportedCacheOverwriteWarning: Overriding the cache handling for GuildManager is unsupported and breaks functionality.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1604) UnsupportedCacheOverwriteWarning: Overriding the cache handling for RoleManager is unsupported and breaks functionality.
Discord bot is ready! 🤖
(node:1604) UnsupportedCacheOverwriteWarning: Overriding the cache handling for PermissionOverwriteManager is unsupported and breaks functionality.
(node:1604) UnsupportedCacheOverwriteWarning: Overriding the cache handling for GuildManager is unsupported and breaks functionality.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1604) UnsupportedCacheOverwriteWarning: Overriding the cache handling for RoleManager is unsupported and breaks functionality.
Discord bot is ready! 🤖
(node:1604) UnsupportedCacheOverwriteWarning: Overriding the cache handling for PermissionOverwriteManager is unsupported and breaks functionality.
app.ts
import { Client, GatewayIntentBits, Guild } from "discord.js";
import { commands } from "./commands";
import { deployCommands } from "./deploy-commands";

const client = new Client({
intents: [
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildScheduledEvents,
GatewayIntentBits.MessageContent,
GatewayIntentBits.Guilds,
],
});

client.once("ready", async () => {

const guild = client.guilds.cache.get('1145437116210352140')?.id as string

console.log("Discord bot is ready! 🤖");
await deployCommands({ guildId: guild })
});

client.on("interactionCreate", async (interaction) => {
if (!interaction.isCommand()) {
return;
}
const { commandName } = interaction;
if (commands[commandName as keyof typeof commands]) {
commands[commandName as keyof typeof commands].execute(interaction);
}
});

client.login("XD")
import { Client, GatewayIntentBits, Guild } from "discord.js";
import { commands } from "./commands";
import { deployCommands } from "./deploy-commands";

const client = new Client({
intents: [
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildScheduledEvents,
GatewayIntentBits.MessageContent,
GatewayIntentBits.Guilds,
],
});

client.once("ready", async () => {

const guild = client.guilds.cache.get('1145437116210352140')?.id as string

console.log("Discord bot is ready! 🤖");
await deployCommands({ guildId: guild })
});

client.on("interactionCreate", async (interaction) => {
if (!interaction.isCommand()) {
return;
}
const { commandName } = interaction;
if (commands[commandName as keyof typeof commands]) {
commands[commandName as keyof typeof commands].execute(interaction);
}
});

client.login("XD")
14 replies
DIAdiscord.js - Imagine an app
Created by shullex on 8/27/2023 in #djs-questions
How to access interaction.options inside button callback
Is it possible to get interaction.options from command handler to the button itself so i could continue with the handler?
if (interaction.isButton()) {
if (interaction.customId.includes("join")) {
///
}
if (interaction.isButton()) {
if (interaction.customId.includes("join")) {
///
}
28 replies
DIAdiscord.js - Imagine an app
Created by shullex on 8/27/2023 in #djs-questions
Category isnt private ?
const eventCategory = await interaction.guild.channels.create({
name: ":dagger: " + interaction.options.getString("event-name") + ":dagger:",
type: ChannelType.GuildCategory,
pemissionOverwrites: [
{
id: playerRole.id,
allow: [PermissionFlagsBits.ViewChannel],
},
{
id: organizerRole.id,
allow: [PermissionFlagsBits.ViewChannel],
},
{
id: interaction.guild.roles.everyone.id,
deny: [PermissionFlagsBits.ViewChannel],
},
],
});
const eventCategory = await interaction.guild.channels.create({
name: ":dagger: " + interaction.options.getString("event-name") + ":dagger:",
type: ChannelType.GuildCategory,
pemissionOverwrites: [
{
id: playerRole.id,
allow: [PermissionFlagsBits.ViewChannel],
},
{
id: organizerRole.id,
allow: [PermissionFlagsBits.ViewChannel],
},
{
id: interaction.guild.roles.everyone.id,
deny: [PermissionFlagsBits.ViewChannel],
},
],
});
5 replies