Annie
Annie
DIAdiscord.js - Imagine an app
Created by Annie on 9/13/2024 in #djs-questions
Trying to get custom set permissions for commands in a Guild.
Ah thanks! The definition needs to be corrected...
"Whether this permission is for a role or a user"
Was confusing me as it doesn't include Channel like it's supposed to.
10 replies
DIAdiscord.js - Imagine an app
Created by Annie on 9/13/2024 in #djs-questions
Trying to get custom set permissions for commands in a Guild.
Thanks for the tip. This will allow me to shorten the code and reduce errors. However I'm still unsure what to do with that ID. The docs say that the ID can be a snowflake for a "role, user, or channel". So I will try to see if I can figure out a request there.
10 replies
DIAdiscord.js - Imagine an app
Created by Annie on 9/13/2024 in #djs-questions
Trying to get custom set permissions for commands in a Guild.
I'm stumped, is there no way to check the permissions of a slash command in a guild if the slash command happens to be defined in the global scope? Since I can use the slash command in the guild, but await guild.commands.fetch() is always empty. Not sure what API I'd need to hit for this. Does Discord not reveal this?
10 replies
DIAdiscord.js - Imagine an app
Created by Annie on 9/13/2024 in #djs-questions
Trying to get custom set permissions for commands in a Guild.
I ended up creating and calling a sync command so that I can get the CommandIDs from Discord over to my client. Then I use the following...
const test = await message.guild.commands.permissions.fetch({ command: command.id })
console.log(test)
const test = await message.guild.commands.permissions.fetch({ command: command.id })
console.log(test)
Which for a command that has custom permissions set up (see image), returns...
[ { id: '108787502663356416', type: 2, permission: true } ]
[ { id: '108787502663356416', type: 2, permission: true } ]
However I'm not sure where to go from there that ID doesn't seem like a permissions enum, and even then it simply says "permission: true". Would really appreciate a hand here.
10 replies
DIAdiscord.js - Imagine an app
Created by Annie on 9/13/2024 in #djs-questions
Trying to get custom set permissions for commands in a Guild.
node -v && pnpm list discord.js
v22.1.0
Legend: production dependency, optional only, dev only

[email protected] <DIRECTORY HIDDEN>

dependencies:
discord.js 14.15.3
node -v && pnpm list discord.js
v22.1.0
Legend: production dependency, optional only, dev only

[email protected] <DIRECTORY HIDDEN>

dependencies:
discord.js 14.15.3
10 replies
DIAdiscord.js - Imagine an app
Created by Annie on 7/23/2024 in #djs-questions
How do I create a User App with Discord.JS?
Ah I see. I'll use my own patch for it, for now and update to use them as defined in the builder when it's in stable. 👍
10 replies
DIAdiscord.js - Imagine an app
Created by Annie on 7/23/2024 in #djs-questions
How do I create a User App with Discord.JS?
10 replies
DIAdiscord.js - Imagine an app
Created by Annie on 7/23/2024 in #djs-questions
How do I create a User App with Discord.JS?
I couldn't find how one would do this in the DiscordJS command builder so I ended up adding them myself. I now have this...
{
options: [ [Object] ],
name: 'send',
name_localizations: undefined,
description: 'Send a message.',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: '0',
dm_permission: undefined,
nsfw: undefined,
integration_types: [ 0, 1 ],
contexts: [ 0, 1, 2 ]
},
{
options: [ [Object] ],
name: 'send',
name_localizations: undefined,
description: 'Send a message.',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: '0',
dm_permission: undefined,
nsfw: undefined,
integration_types: [ 0, 1 ],
contexts: [ 0, 1, 2 ]
},
However when I use it in a server it says that I don't have permission (and that only I can see the response). Edit: This was a mistake with permission settings. I can use other apps just fine, is this a restriction between verified and non-verified bots?
10 replies
DIAdiscord.js - Imagine an app
Created by Annie on 7/23/2024 in #djs-questions
How do I create a User App with Discord.JS?
So I'm not sure why the commands aren't showing up.
10 replies
DIAdiscord.js - Imagine an app
Created by Annie on 7/23/2024 in #djs-questions
How do I create a User App with Discord.JS?
No description
10 replies