Lixeiro Charmoso
Lixeiro Charmoso
DIAdiscord.js - Imagine an app
Created by Lixeiro Charmoso on 7/29/2024 in #djs-questions
How to get attachments from a message?
ChatGPT suggested me this to get the attachments
const attachments = await Promise.all(
msg.attachments.map(async (obj) => {
const response = await axios.get(obj.proxyURL, { responseType: 'arraybuffer' });
const buffer = Buffer.from(response.data);
return new AttachmentBuilder(buffer, { name: obj.name });
})
);
const attachments = await Promise.all(
msg.attachments.map(async (obj) => {
const response = await axios.get(obj.proxyURL, { responseType: 'arraybuffer' });
const buffer = Buffer.from(response.data);
return new AttachmentBuilder(buffer, { name: obj.name });
})
);
But it works only for images, not for files such as a .zip
5 replies
DIAdiscord.js - Imagine an app
Created by Lixeiro Charmoso on 7/29/2024 in #djs-questions
How to get attachments from a message?
I delete the message right after that
5 replies
DIAdiscord.js - Imagine an app
Created by Lixeiro Charmoso on 2/1/2024 in #djs-questions
Is possible to trigger an ephemeral message without setting "ephemeral: true"?
But i dont believe it'll have because i cannot reproduce that issue. Maybe it only happens in mobile and maybe in some specific mobile version, because i tried with mobile too without sucess
13 replies
DIAdiscord.js - Imagine an app
Created by Lixeiro Charmoso on 2/1/2024 in #djs-questions
Is possible to trigger an ephemeral message without setting "ephemeral: true"?
I want to find how to use to see if there is anything similar in my code
13 replies
DIAdiscord.js - Imagine an app
Created by Lixeiro Charmoso on 2/1/2024 in #djs-questions
Is possible to trigger an ephemeral message without setting "ephemeral: true"?
Maybe i overlooked something, idk
13 replies
DIAdiscord.js - Imagine an app
Created by Lixeiro Charmoso on 2/1/2024 in #djs-questions
Is possible to trigger an ephemeral message without setting "ephemeral: true"?
Sorry, after reading the docs i didnt figure out the usage
13 replies
DIAdiscord.js - Imagine an app
Created by Lixeiro Charmoso on 2/1/2024 in #djs-questions
Is possible to trigger an ephemeral message without setting "ephemeral: true"?
Maybe i'll force "ephemeral: false" and pray for the best
13 replies
DIAdiscord.js - Imagine an app
Created by Lixeiro Charmoso on 2/1/2024 in #djs-questions
Is possible to trigger an ephemeral message without setting "ephemeral: true"?
This is making me crazy
13 replies
DIAdiscord.js - Imagine an app
Created by Lixeiro Charmoso on 2/1/2024 in #djs-questions
Is possible to trigger an ephemeral message without setting "ephemeral: true"?
But what kind of code should i look for?
13 replies
DIAdiscord.js - Imagine an app
Created by KingBaboon on 12/17/2023 in #djs-questions
How to add options to a slash command?
console.log(userToBePinged)
26 replies
DIAdiscord.js - Imagine an app
Created by KingBaboon on 12/17/2023 in #djs-questions
How to add options to a slash command?
Put a console.log to make sure
26 replies
DIAdiscord.js - Imagine an app
Created by KingBaboon on 12/17/2023 in #djs-questions
How to add options to a slash command?
Is the user object i think
26 replies
DIAdiscord.js - Imagine an app
Created by KingBaboon on 12/17/2023 in #djs-questions
How to add options to a slash command?
const userToBePinged = interaction.options.getUser('user') ?? "";
26 replies
DIAdiscord.js - Imagine an app
Created by KingBaboon on 12/17/2023 in #djs-questions
How to add options to a slash command?
As far as i know, no. But it may be possible
26 replies
DIAdiscord.js - Imagine an app
Created by KingBaboon on 12/17/2023 in #djs-questions
How to add options to a slash command?
Yes
26 replies
DIAdiscord.js - Imagine an app
Created by KingBaboon on 12/17/2023 in #djs-questions
How to add options to a slash command?
User must be user
26 replies
DIAdiscord.js - Imagine an app
Created by KingBaboon on 12/17/2023 in #djs-questions
How to add options to a slash command?
setDMPermission is to not allow the command be run in the bot DMs setDefaultMemberPermissions permission that is allowed to execute the command
26 replies
DIAdiscord.js - Imagine an app
Created by KingBaboon on 12/17/2023 in #djs-questions
How to add options to a slash command?
new SlashCommandBuilder()
.setName('docs')
.setDescription('Read the docs message')
.addUserOption(option =>
option.setName('target')
.setDescription('Ping the user')
.setRequired(false))
.setDefaultMemberPermissions(PermissionFlagsBits.ManageRoles)
.setDMPermission(false),
new SlashCommandBuilder()
.setName('docs')
.setDescription('Read the docs message')
.addUserOption(option =>
option.setName('target')
.setDescription('Ping the user')
.setRequired(false))
.setDefaultMemberPermissions(PermissionFlagsBits.ManageRoles)
.setDMPermission(false),
26 replies
DIAdiscord.js - Imagine an app
Created by KingBaboon on 12/17/2023 in #djs-questions
How to add options to a slash command?
26 replies
DIAdiscord.js - Imagine an app
Created by Lixeiro Charmoso on 12/17/2023 in #djs-questions
How to create a button with permission
Thank you for the fast response. It worked
11 replies