Mysterious_Dev
Mysterious_Dev
DIAdiscord.js - Imagine an app
Created by Mysterious_Dev on 8/6/2023 in #djs-questions
Get Guild Rules Channel
Hi ! Is there a way with Discord.JS to retrieve the rules channel that is defined in a server's settings other than using the ID? Mysterious_Dev
4 replies
DIAdiscord.js - Imagine an app
Created by Mysterious_Dev on 6/14/2023 in #djs-questions
Get interaction of an interaction
Hi ! I wanted to know, with discord.js 14.11.0, there is a way to get an interaction sourced of another. To explain, I want to modify an embed with context menu and a modal (the modal appear after i click on the context menu action) and with that, I don't know how I can get the message of context menu when I submit all fields of the modal. https://github.com/Les-Moddeurs-Francais/Moddeur-Ultime/tree/suggestions Thanks in advance ^^ Mysterious_Dev
5 replies
DIAdiscord.js - Imagine an app
Created by Mysterious_Dev on 4/25/2023 in #djs-questions
Add field to Guild Rest
Hi ! I want to know, with Discord.JS, there is a way to add extra fields to Guild Rest Request ? To explain, I want to add field for Rules Screening (de-documented) with an extra package created by me. https://github.com/discord/discord-api-docs/commit/decd6343a5b03c6622d91a64383cf644594e486e Thanks in advance ^^ Mysterious_Dev
8 replies
DIAdiscord.js - Imagine an app
Created by Mysterious_Dev on 3/30/2023 in #djs-questions
Get author of thread channel
Hey ! I wanted to know, I didn't see how cn I get the author of a thread (ThreadChannel). If anyone knows how, I would appreciate it ^^ Thanks in advance ^^ https://discord.js.org/#/docs/discord.js/main/class/ThreadChannel
4 replies
DIAdiscord.js - Imagine an app
Created by Mysterious_Dev on 3/20/2023 in #djs-questions
[TypeScript] Non required option for slash commands
11 replies
DIAdiscord.js - Imagine an app
Created by Mysterious_Dev on 3/13/2023 in #djs-questions
ActionRowBuilder error for Modal
Hello ! When I upgrade to 14.8.0, I have a strange error for ActionRowBuilder (modal). My code :
const suggestionTitle = new TextInputBuilder()
.setCustomId("suggestion_title")
.setLabel("Titre de la suggestion")
.setStyle(TextInputStyle.Short);

const titleRow = new ActionRowBuilder().addComponents(suggestionTitle);

const suggestionModal = new ModalBuilder()
.setCustomId("suggestion")
.setTitle("Suggestion");

suggestionModal.addComponents(titleRow)

await interaction.showModal(suggestionModal);
const suggestionTitle = new TextInputBuilder()
.setCustomId("suggestion_title")
.setLabel("Titre de la suggestion")
.setStyle(TextInputStyle.Short);

const titleRow = new ActionRowBuilder().addComponents(suggestionTitle);

const suggestionModal = new ModalBuilder()
.setCustomId("suggestion")
.setTitle("Suggestion");

suggestionModal.addComponents(titleRow)

await interaction.showModal(suggestionModal);
The error:
error TS2345: Argument of type '[ActionRowBuilder<AnyComponentBuilder>]' is not assignable to parameter of type 'RestOrArray<ActionRowBuilder<TextInputBuilder> | APIActionRowComponent<APITextInputComponent>>'.
Type '[ActionRowBuilder<AnyComponentBuilder>]' is not assignable to type '[(ActionRowBuilder<TextInputBuilder> | APIActionRowComponent<APITextInputComponent>)[]]'.
Type 'ActionRowBuilder<AnyComponentBuilder>' is missing the following properties from type '(ActionRowBuilder<TextInputBuilder> | APIActionRowComponent<APITextInputComponent>)[]': length, pop, push, concat, and 29 more.

21 suggestionModal.addComponents(titleRow)
error TS2345: Argument of type '[ActionRowBuilder<AnyComponentBuilder>]' is not assignable to parameter of type 'RestOrArray<ActionRowBuilder<TextInputBuilder> | APIActionRowComponent<APITextInputComponent>>'.
Type '[ActionRowBuilder<AnyComponentBuilder>]' is not assignable to type '[(ActionRowBuilder<TextInputBuilder> | APIActionRowComponent<APITextInputComponent>)[]]'.
Type 'ActionRowBuilder<AnyComponentBuilder>' is missing the following properties from type '(ActionRowBuilder<TextInputBuilder> | APIActionRowComponent<APITextInputComponent>)[]': length, pop, push, concat, and 29 more.

21 suggestionModal.addComponents(titleRow)
Thanks in advance ^^ Mysterious_Dev
5 replies
DIAdiscord.js - Imagine an app
Created by Mysterious_Dev on 3/10/2023 in #djs-questions
Which Event is fired when a tag of thread (Forum Channel) is updated ?
Hey ! I wanted to know, which event can I use to detect when a tag is added or deleted for a thread (Forum channel) ? Thanks in advance ^^ Mysterious_Dev
3 replies
DIAdiscord.js - Imagine an app
Created by Mysterious_Dev on 11/10/2022 in #djs-questions
Crash with new select menus
4 replies
DIAdiscord.js - Imagine an app
Created by Mysterious_Dev on 6/21/2022 in #djs-questions
messageReactionAdd not fired
Hi 👋 , The event messageReactionAdd is not fired when I try to detect when a reaction is added to a message. My code :
client.on("messageReactionAdd", (messageReaction, user) => {
console.log("Test")
});
client.on("messageReactionAdd", (messageReaction, user) => {
console.log("Test")
});
const { Client, Collection, GatewayIntentBits, Partials } = require("discord.js");
require('dotenv').config();

const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMessageReactions, GatewayIntentBits.GuildEmojisAndStickers, GatewayIntentBits.DirectMessages, GatewayIntentBits.DirectMessageReactions], partials: [Partials.Channel, Partials.Reaction]
});
module.exports = client;

// Global Variables
client.commands = new Collection();
client.slashCommands = new Collection();

// Initializing the project
require("./handler")(client);

client.login(process.env.DISCORD_TOKEN);
const { Client, Collection, GatewayIntentBits, Partials } = require("discord.js");
require('dotenv').config();

const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMessageReactions, GatewayIntentBits.GuildEmojisAndStickers, GatewayIntentBits.DirectMessages, GatewayIntentBits.DirectMessageReactions], partials: [Partials.Channel, Partials.Reaction]
});
module.exports = client;

// Global Variables
client.commands = new Collection();
client.slashCommands = new Collection();

// Initializing the project
require("./handler")(client);

client.login(process.env.DISCORD_TOKEN);
Discord.JS version : 14.0.0-dev.1654819804-2791c86. Thanks in advance Mysterious_Dev
4 replies
DIAdiscord.js - Imagine an app
Created by Mysterious_Dev on 6/19/2022 in #djs-questions
Create thread linked to message
Hey ! I want to create a thread that is link to a message, but the function startThread as an error (console say it's not a function). Thanks in advance Mysterious_Dev
8 replies