Youssef
Youssef
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by Youssef on 8/10/2023 in #djs-questions
The expected type comes from property 'content' which is declared here on type 'InteractionReplyOpti
const type: string = this.options.interaction.deferred || this.options.interaction.replied ? "editReply" : "reply";

await this.options.interaction[type]({
// code
const type: string = this.options.interaction.deferred || this.options.interaction.replied ? "editReply" : "reply";

await this.options.interaction[type]({
// code
like this it don't cause any problems but when i specify the type like this
const type: "reply" | "editReply" = this.options.interaction.deferred || this.options.interaction.replied ? "editReply" : "reply";
const type: "reply" | "editReply" = this.options.interaction.deferred || this.options.interaction.replied ? "editReply" : "reply";
it give me this error
No overload matches this call.
Overload 1 of 2, '(options: InteractionReplyOptions & { fetchReply: true; } & (string | MessagePayload | InteractionEditReplyOptions)): Promise<...>', gave the following error.
Type 'null' is not assignable to type 'string | undefined'.
Overload 2 of 2, '(options: (string | MessagePayload | InteractionReplyOptions) & (string | MessagePayload | InteractionEditReplyOptions)): Promise<...> | Promise<...>', gave the following error.
Type 'null' is not assignable to type 'string | undefined'.ts(2769)
index.d.ts(5888, 3): The expected type comes from property 'content' which is declared here on type 'InteractionReplyOptions & { fetchReply: true; } & (string | MessagePayload | InteractionEditReplyOptions)'
No overload matches this call.
Overload 1 of 2, '(options: InteractionReplyOptions & { fetchReply: true; } & (string | MessagePayload | InteractionEditReplyOptions)): Promise<...>', gave the following error.
Type 'null' is not assignable to type 'string | undefined'.
Overload 2 of 2, '(options: (string | MessagePayload | InteractionReplyOptions) & (string | MessagePayload | InteractionEditReplyOptions)): Promise<...> | Promise<...>', gave the following error.
Type 'null' is not assignable to type 'string | undefined'.ts(2769)
index.d.ts(5888, 3): The expected type comes from property 'content' which is declared here on type 'InteractionReplyOptions & { fetchReply: true; } & (string | MessagePayload | InteractionEditReplyOptions)'
15 replies
DIAdiscord.js - Imagine an app
Created by Youssef on 7/20/2023 in #djs-questions
Get All users banners
So im trying to get all banners of server members.. what im doing is fetching all members let members = await guild.members.fetch(); but all the members here have banners as null. ik they need to be force fetched. so i tried something like this
let banners = [];
members.forEach(async (member) => {
const user = await member.fetch({ force: true });
console.log(user.banner)
if (user.banner) banners.push(user.banner)
})
let banners = [];
members.forEach(async (member) => {
const user = await member.fetch({ force: true });
console.log(user.banner)
if (user.banner) banners.push(user.banner)
})
but it still gives the same output
34 replies
DIAdiscord.js - Imagine an app
Created by Youssef on 7/15/2023 in #djs-voice
Player emit idle event without playing
let connection = joinVoiceChannel({
channelId: voiceChannel.id,
guildId: voiceChannel.guild.id,
adapterCreator: voiceChannel.guild.voiceAdapterCreator,
group: client.user.id,
});

let player = createAudioPlayer();
let resource = createAudioResource(suraURL); // suraurl is a valid mp3


connection.subscribe(player);
player.play(resource);
let connection = joinVoiceChannel({
channelId: voiceChannel.id,
guildId: voiceChannel.guild.id,
adapterCreator: voiceChannel.guild.voiceAdapterCreator,
group: client.user.id,
});

let player = createAudioPlayer();
let resource = createAudioResource(suraURL); // suraurl is a valid mp3


connection.subscribe(player);
player.play(resource);
5 replies
DIAdiscord.js - Imagine an app
Created by Youssef on 11/20/2022 in #djs-voice
bot finished playing
How to understand that a bot has finished playing a file to start a new one?
15 replies
DIAdiscord.js - Imagine an app
Created by Youssef on 10/31/2022 in #djs-questions
Why i can't send mutiple images in one embed
Why this feature dont exist in discord.js? you can still use it with json but it will be better to use like .setImages([images array])
27 replies
DIAdiscord.js - Imagine an app
Created by Youssef on 9/7/2022 in #djs-questions
registering commands problem
24 replies
DIAdiscord.js - Imagine an app
Created by Youssef on 8/21/2022 in #djs-questions
loading Slash Commands with REST dont works
35 replies
DIAdiscord.js - Imagine an app
Created by Youssef on 8/21/2022 in #djs-questions
ImageURLOptions
why is StaticImageURLOptions and ImageURLOptions dont exist in main docs ?
9 replies
DIAdiscord.js - Imagine an app
Created by Youssef on 7/26/2022 in #djs-questions
default_member_permissions
if ('default_member_permissions' in command) { ^ TypeError: Cannot use 'in' operator to search for 'default_member_permissions' in ping
11 replies
DIAdiscord.js - Imagine an app
Created by Youssef on 7/23/2022 in #djs-voice
about Stream
i can make my bot join a voice channel and make a stream to share a video or something
14 replies
DIAdiscord.js - Imagine an app
Created by Youssef on 7/20/2022 in #djs-questions
Interaction problems
50 replies