paxton!!
paxton!!
DIAdiscord.js - Imagine an app
Created by paxton!! on 3/6/2024 in #djs-questions
How do I add a role with discord.js
const target = interaction.options.getUser('target');
const role = interaction.options.getRole('role');
target.addRole(role);
const target = interaction.options.getUser('target');
const role = interaction.options.getRole('role');
target.addRole(role);
is this how i add the role?
4 replies
DIAdiscord.js - Imagine an app
Created by paxton!! on 3/6/2024 in #djs-questions
check if role is set to certain role ids
how do i check if the role is set to certain ids?
const role = interaction.options.getRole('role').id;
role !== '1214610538382884959' || '1171216386618572840' || '1171216297661567000'
const role = interaction.options.getRole('role').id;
role !== '1214610538382884959' || '1171216386618572840' || '1171216297661567000'
it still runs the following code in the if statement (the second line is only conditions) even though the role is equal to one in the list i have verified const role is correct and prints the correct id
7 replies
DIAdiscord.js - Imagine an app
Created by paxton!! on 3/5/2024 in #djs-questions
I need help applying functions to my discord bot.
Here is the code block for the function of confirm:
if (confirmation.customId === 'confirm') {

await confirmation.update({
embeds: [{
title: 'Lockdown confirmed!',
description: `The lockdown will commence in 5 seconds.`,
color: '15548997',
}],
ephemeral: true,
components: [],
},);

}
if (confirmation.customId === 'confirm') {

await confirmation.update({
embeds: [{
title: 'Lockdown confirmed!',
description: `The lockdown will commence in 5 seconds.`,
color: '15548997',
}],
ephemeral: true,
components: [],
},);

}
i need a way to remove the sendmessage permissions of the role 1171206894799552622 of certain channels, if someone could write the code it'd be great, the id's are below. 1174066163941126215, 1174066275618664560, 1174066357797658764, 1174066422637408396
114 replies