Stiefanek
Stiefanek
DIAdiscord.js - Imagine an app
Created by Stiefanek on 9/29/2024 in #djs-questions
How would I lock a command behind a specific role?
I want to make a command that only a specific role can run.
15 replies
DIAdiscord.js - Imagine an app
Created by Stiefanek on 8/26/2024 in #djs-questions
Error [ApplicationCommandPermissionsTokenMissing]: Editing application command permissions requires
await guild.commands.permissions.add({
command : '1277387223595089932',
permissions: [
{
id: '1277347927500652647',
type : 'ROLE',
permission: true,
}
]
})
await guild.commands.permissions.add({
command : '1277387223595089932',
permissions: [
{
id: '1277347927500652647',
type : 'ROLE',
permission: true,
}
]
})
When trying to use this code it says "Error [ApplicationCommandPermissionsTokenMissing]: Editing application command permissions requires an OAuth2 bearer token, but none was provided." Where do I put the bearer token in?
19 replies
DIAdiscord.js - Imagine an app
Created by Stiefanek on 8/26/2024 in #djs-questions
The application did not respond.
When I use the command it says "The application did not respond", I get no errors.
const { Client , Message, MessageEmbed, CommandInteraction, MessageActionRow, MessageButton } = require('discord.js')


const noblox = require('noblox.js')
const { Group_ID} = require('../config.json')
const { SlashCommandBuilder, EmbedBuilder } = require('@discordjs/builders')



module.exports = {

name: 'Promote',
description: 'Promotes a member in the group',
data : new SlashCommandBuilder()
.setName('promote')
.setDescription('Promotes a player')

.addStringOption(option =>
option.setName('username')
.setDescription('User to promote').setRequired(true)),





/**
*
* @param {Client} bot
* @param {Message} message
* @param {*} args
*/


async execute(bot , message, args) {



message.reply({ embeds: [embed] })

},

/**
*
* @param {Client} bot
* @param {CommandInteraction} interaction
*/

async slashexecute(bot , interaction) {

return console.log(interaction.commandId)

const username = interaction.options.getString('username')

await interaction.deferReply({ ephemeral: true})

try {
const id = await noblox.getIdFromUsername(username)
noblox.promote(Group_ID, id)
interaction.editReply({content : `Successfully Promoted **${username}**`})
} catch (error) {
interaction.editReply({content:error.message })
}

},
}
const { Client , Message, MessageEmbed, CommandInteraction, MessageActionRow, MessageButton } = require('discord.js')


const noblox = require('noblox.js')
const { Group_ID} = require('../config.json')
const { SlashCommandBuilder, EmbedBuilder } = require('@discordjs/builders')



module.exports = {

name: 'Promote',
description: 'Promotes a member in the group',
data : new SlashCommandBuilder()
.setName('promote')
.setDescription('Promotes a player')

.addStringOption(option =>
option.setName('username')
.setDescription('User to promote').setRequired(true)),





/**
*
* @param {Client} bot
* @param {Message} message
* @param {*} args
*/


async execute(bot , message, args) {



message.reply({ embeds: [embed] })

},

/**
*
* @param {Client} bot
* @param {CommandInteraction} interaction
*/

async slashexecute(bot , interaction) {

return console.log(interaction.commandId)

const username = interaction.options.getString('username')

await interaction.deferReply({ ephemeral: true})

try {
const id = await noblox.getIdFromUsername(username)
noblox.promote(Group_ID, id)
interaction.editReply({content : `Successfully Promoted **${username}**`})
} catch (error) {
interaction.editReply({content:error.message })
}

},
}
11 replies