ninbura
ninbura
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by ninbura on 8/27/2023 in #djs-questions
edit ephemeral message without access to interaction object
// example code
const message = await channel.messages.getch(messageId)

message.edit({content: `The voice channel linked in this message has since been deleted...`})

// error
<rejected> DiscordAPIError[10008]: Unknown Message
// example code
const message = await channel.messages.getch(messageId)

message.edit({content: `The voice channel linked in this message has since been deleted...`})

// error
<rejected> DiscordAPIError[10008]: Unknown Message
From my understanding ephemeral messages are editable via the interaction's token. So, the Discord api allows for this functionality... But there is currently no method for doing this via djs?
7 replies
DIAdiscord.js - Imagine an app
Created by ninbura on 6/25/2023 in #djs-questions
Channel's position properties appear to be incoherent
19 replies
DIAdiscord.js - Imagine an app
Created by ninbura on 6/23/2022 in #djs-questions
Manufacture PermissionOverwrites object
I'm wondering if it's possible to manufacture a PermissionOverwrites object. I can create an object with all the same properties, but the API rejects the object. When I compare to one in the cache I can see that the object itself has a type of PermissionOverwrites:
PermissionOverwrites object pulled from cache:
PermissionOverwrites {
id: '191458771837386752',
type: 'member',
deny: Permissions { bitfield: 377957122048n },
allow: Permissions { bitfield: 3072n }
}

PermissionOverwrites I created:
{
id: '191458771837386752',
type: 'member',
deny: Permissions { bitfield: 377957122048n },
allow: Permissions { bitfield: 3072n }
}
PermissionOverwrites object pulled from cache:
PermissionOverwrites {
id: '191458771837386752',
type: 'member',
deny: Permissions { bitfield: 377957122048n },
allow: Permissions { bitfield: 3072n }
}

PermissionOverwrites I created:
{
id: '191458771837386752',
type: 'member',
deny: Permissions { bitfield: 377957122048n },
allow: Permissions { bitfield: 3072n }
}
I figured out how to create a Permissions object within the overwrite, but I can't seem to figure out how to make the overwrite object itself a PermissionOverwrites object.
4 replies