José
José
DIAdiscord.js - Imagine an app
Created by José on 7/10/2023 in #djs-questions
Pass variables into <ShardingManager>.broadcastEval
4 replies
DIAdiscord.js - Imagine an app
Created by José on 7/10/2023 in #djs-questions
Pass variables into <ShardingManager>.broadcastEval
npm list discord.js => [email protected] node -v => v18.16.1
4 replies
DIAdiscord.js - Imagine an app
Created by José on 5/18/2023 in #djs-questions
shadow reply an interaction
thanks
9 replies
DIAdiscord.js - Imagine an app
Created by José on 5/18/2023 in #djs-questions
shadow reply an interaction
yeah, this work
9 replies
DIAdiscord.js - Imagine an app
Created by José on 5/18/2023 in #djs-questions
shadow reply an interaction
I have another commands with the same problem one of them is a StringSelectMenu type, after receiving the interaction I want to edit the message, but <Interaction>.editReply() does not work, so I use <Interaction>.message.edit, but this message that the BOT did not respond appears
9 replies
DIAdiscord.js - Imagine an app
Created by José on 5/14/2023 in #djs-questions
[TypeScript] - The VS Code alert a ghost error when i inset a ActionRow in message components array
Ow yes, this solved my problem, thanks
5 replies
DIAdiscord.js - Imagine an app
Created by José on 5/12/2023 in #djs-questions
Incorrect type in TypeScript?
I did this, but now i have a new problem... Firstly, see my event InteractionCreate
import { BaseInteraction, ChatInputCommandInteraction } from "discord.js";
import Bot from "../CustomClient";

const event = {
eventName: "interactionCreate",
function: async (client: Bot, int: BaseInteraction) => {

const command = client.commands.find(x => x.name == (int as ChatInputCommandInteraction).commandName);

if (int.isCommand()) await command?.command(client, int, command);
if (int.isButton()) await command?.button(client, int, command);

}
}

export default event;
import { BaseInteraction, ChatInputCommandInteraction } from "discord.js";
import Bot from "../CustomClient";

const event = {
eventName: "interactionCreate",
function: async (client: Bot, int: BaseInteraction) => {

const command = client.commands.find(x => x.name == (int as ChatInputCommandInteraction).commandName);

if (int.isCommand()) await command?.command(client, int, command);
if (int.isButton()) await command?.button(client, int, command);

}
}

export default event;
Well, in the block await command.command(client, int, command); i'm getting this problem when i try to convert int (who is BaseInteraction) to ChatInputCommandInteraction, as my function requires function type: (command.command(client: Discord.Client, int: ChatInputCommandInteraction, command: Command)):
Argument of type 'CommandInteraction<CacheType>' is not assignable to parameter of type 'ChatInputCommandInteraction<CacheType>'.
Property types 'commandType' are incompatible.
Type 'ApplicationCommandType' cannot be assigned to type 'ApplicationCommandType.ChatInput'.
Argument of type 'CommandInteraction<CacheType>' is not assignable to parameter of type 'ChatInputCommandInteraction<CacheType>'.
Property types 'commandType' are incompatible.
Type 'ApplicationCommandType' cannot be assigned to type 'ApplicationCommandType.ChatInput'.
4 replies
DIAdiscord.js - Imagine an app
Created by José on 5/12/2023 in #djs-questions
Incorrect type in TypeScript?
OBS: The type of int is CommandInteraction<CacheType>
4 replies