Goose
Goose
DIAdiscord.js - Imagine an app
Created by Goose on 1/21/2024 in #djs-questions
Permission Overwrites
Does the bot need administrator permission to set permission overwrites on a channel? It's only working for me if the bot has administrator permissions, but I feel like that shouldn't be the case. discord version: [email protected] node version: v20.10.0
const newChannel = await i.guild.channels.create({
name: ticketName,
type: ChannelType.GuildText,
parent: ticketCategoryId,
permissionOverwrites: [
{
id: i.guild.roles.everyone.id,
deny: [PermissionsBitField.Flags.ViewChannel],
},
{
id: i.user.id,
deny: [PermissionsBitField.Flags.SendMessages],
},
],
})
const newChannel = await i.guild.channels.create({
name: ticketName,
type: ChannelType.GuildText,
parent: ticketCategoryId,
permissionOverwrites: [
{
id: i.guild.roles.everyone.id,
deny: [PermissionsBitField.Flags.ViewChannel],
},
{
id: i.user.id,
deny: [PermissionsBitField.Flags.SendMessages],
},
],
})
8 replies
DIAdiscord.js - Imagine an app
Created by Goose on 4/17/2023 in #djs-questions
Attachment in embed
Hey, how can I turn interaction.options.getAttachment("image"); into an attachment to use in an embed? I've tried to do const attachment = new AttachmentBuilder(interaction.options.getAttachment("image"), "image.png"); but it says "The resource must be a string, Buffer or a valid file stream." and I can't figure out how to turn it into a buffer. Could anyone help?
7 replies