Nlmyr
Nlmyr
DIAdiscord.js - Imagine an app
Created by Nlmyr on 5/20/2024 in #djs-questions
member.joinedAt = null
When I use the GuildMemberRemove Event the member.joinedAt is null. What am I doing wrong? Intents / Partials:
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildModeration,
],
partials: [
Partials.User,
Partials.Message,
Partials.Channel,
Partials.GuildMember,
],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildModeration,
],
partials: [
Partials.User,
Partials.Message,
Partials.Channel,
Partials.GuildMember,
],
Event:
const joinedAt = member.joinedTimestamp;
const leftAt = Date.now();
const duration = leftAt - joinedAt;

const embed = new EmbedBuilder()
.setColor("Red")
.setTitle("Mitglied verlassen")
.setDescription(`- \`${member.user.tag}\` [<@${member.user.id}>]`)
.setTimestamp()
.addFields(
{
name: "Beigetreten:",
value:
`<t:${Math.floor(member.joinedTimestamp / 1000)}:F>` ||
member.joinedTimestamp,
inline: true,
},
{
name: "🕛 :",
value: ms(duration, { long: true }),
inline: true,
},
{
name: "Beigetreten (legacy):",
value: `- ${member.joinedAt}`,
inline: true,
}
)
.setFooter({ text: `👥 : ${member.guild.memberCount}` });

channel.send({ embeds: [embed] });
const joinedAt = member.joinedTimestamp;
const leftAt = Date.now();
const duration = leftAt - joinedAt;

const embed = new EmbedBuilder()
.setColor("Red")
.setTitle("Mitglied verlassen")
.setDescription(`- \`${member.user.tag}\` [<@${member.user.id}>]`)
.setTimestamp()
.addFields(
{
name: "Beigetreten:",
value:
`<t:${Math.floor(member.joinedTimestamp / 1000)}:F>` ||
member.joinedTimestamp,
inline: true,
},
{
name: "🕛 :",
value: ms(duration, { long: true }),
inline: true,
},
{
name: "Beigetreten (legacy):",
value: `- ${member.joinedAt}`,
inline: true,
}
)
.setFooter({ text: `👥 : ${member.guild.memberCount}` });

channel.send({ embeds: [embed] });
8 replies
DIAdiscord.js - Imagine an app
Created by Nlmyr on 5/10/2023 in #djs-questions
Update presence @discordjs/core
Hey how can i update the presence? I have no shardID. https://discord.js.org/docs/packages/core/main/Client:Class#updatePresence
10 replies
DIAdiscord.js - Imagine an app
Created by Nlmyr on 3/21/2023 in #djs-questions
Message Attachment
Hello, how can I send file attachments? I have the following code:
const attachment = new Attachment(
path.join(
__dirname,
"../",
"reports",
`ticket-${row.id}.html.rename`
)
);

await interaction.channel.send(
`Ticket #${row.id} closed by ${interaction.user.username}`,
{
files: [attachment],
}
);
const attachment = new Attachment(
path.join(
__dirname,
"../",
"reports",
`ticket-${row.id}.html.rename`
)
);

await interaction.channel.send(
`Ticket #${row.id} closed by ${interaction.user.username}`,
{
files: [attachment],
}
);
and get the following error:
TypeError: Cannot use 'in' operator to search for 'size' in
TypeError: Cannot use 'in' operator to search for 'size' in
7 replies
DIAdiscord.js - Imagine an app
Created by Nlmyr on 1/12/2023 in #djs-questions
Missing author in message object
Hey when i listen to the messageDeleted Event i get the message. Now i want the author but its null
7 replies
DIAdiscord.js - Imagine an app
Created by Nlmyr on 10/19/2022 in #djs-questions
No focused option for autocomplete interaction
Hey I get the following error. How can I handle this.
TypeError [AutocompleteInteractionOptionNoFocusedOption]: No focused option for autocomplete interaction.
TypeError [AutocompleteInteractionOptionNoFocusedOption]: No focused option for autocomplete interaction.
16 replies
DIAdiscord.js - Imagine an app
Created by Nlmyr on 10/19/2022 in #djs-questions
Choices on slash command
Hey, I would have a slash command where users can choose from entries. but on every guild there are others. is it better to use the autocompletion or something else?
3 replies
DIAdiscord.js - Imagine an app
Created by Nlmyr on 10/8/2022 in #djs-questions
How can I add commands in the bots profile
3 replies
DIAdiscord.js - Imagine an app
Created by Nlmyr on 7/9/2022 in #djs-questions
CommandInteraction Option max_value
Hey, i have the following options configured:
options: [
{
name: "amount",
description: "The amount of messages to delete",
type: "NUMBER",
required: true,
max_value: 100,
},
],
options: [
{
name: "amount",
description: "The amount of messages to delete",
type: "NUMBER",
required: true,
max_value: 100,
},
],
When i deploy my data then the command doesnt show up :/
29 replies
DIAdiscord.js - Imagine an app
Created by Nlmyr on 6/19/2022 in #djs-questions
Force fetching a guild
Hey, i need to fetch a guild with its members. How can i fetch them with force?
fetch(guild: guildId, force: true);
fetch(guild: guildId, force: true);
That doesn't work for me :/
19 replies