Skuffies
Skuffies
DIAdiscord.js - Imagine an app
Created by Skuffies on 10/28/2023 in #djs-questions
Message content is empty despite of intents
Hello! I'm trying to get the content of the message being reacted to with my bot but the content is always empty. I have both "Server Members Intent" and Message Content Intent" turned on in my developer dashboard and them required with:
'Guilds',
'GuildMembers',
"GuildMessages",
"GuildMessageReactions",
'Guilds',
'GuildMembers',
"GuildMessages",
"GuildMessageReactions",
reactionChannel.messages.fetch(reaction.message.id).then(message => {
console.log(message);
console.log(message.content);
})
reactionChannel.messages.fetch(reaction.message.id).then(message => {
console.log(message);
console.log(message.content);
})
I am successfully able to fetch the message but the content is just empty. What am I missing in order to be able fetch and read the message content?
4 replies
DIAdiscord.js - Imagine an app
Created by Skuffies on 12/4/2022 in #djs-questions
Amount of messages deleted
Hello, how do you get the amount of messages that were successfully deleted with bulkDelete()? Is there a way to see this in the docs for future reference as well?
5 replies
DIAdiscord.js - Imagine an app
Created by Skuffies on 12/3/2022 in #djs-questions
Cannot set properties of undefined (setting 'commands')
My code:
const fs = require('fs');
const { Collection } = require('discord.js');

function registerCommands(client) {
const commands = [];

client.commands = new Collection();
}

module.exports = register();
const fs = require('fs');
const { Collection } = require('discord.js');

function registerCommands(client) {
const commands = [];

client.commands = new Collection();
}

module.exports = register();
const { Client } = require('discord.js');

const client = new Client({
intents: [
'Guilds',
'GuildMessages',
'MessageContent'
]
});

require('./functions/registerCommands.js').register(client);
const { Client } = require('discord.js');

const client = new Client({
intents: [
'Guilds',
'GuildMessages',
'MessageContent'
]
});

require('./functions/registerCommands.js').register(client);
Error:
client.commands = new Collection();
^

TypeError: Cannot set properties of undefined (setting 'commands')
client.commands = new Collection();
^

TypeError: Cannot set properties of undefined (setting 'commands')
4 replies
DIAdiscord.js - Imagine an app
Created by Skuffies on 11/12/2022 in #djs-questions
How to get the attachment path?
Hello, I am trying to use an image in an embed but it won't show. The image is in the same folder.
let embed = new EmbedBuilder()
.setTitle('Title')
.setDescription('Description')
.setImage('attachment://screenshot.png')

interaction.editReply({embeds: [embed]})
let embed = new EmbedBuilder()
.setTitle('Title')
.setDescription('Description')
.setImage('attachment://screenshot.png')

interaction.editReply({embeds: [embed]})
How do I set the image properly?
34 replies
DIAdiscord.js - Imagine an app
Created by Skuffies on 11/12/2022 in #djs-questions
Is requiring intents deprecated or something?
I have been using require {GatewayIntentBits: Intents} = require('discord.js') but it seems to accept intents directly in the intent options. When was this changed?
4 replies
DIAdiscord.js - Imagine an app
Created by Skuffies on 10/27/2022 in #djs-questions
Error when trying to delete a bot
Hello, I'm trying to delete a Discord Application/Bot that's in my team but I get the error message "You are not authorized to perform this action on this application" after typing in the name and my 2FA code. I have full control over the team.
3 replies