Added permission levels to all commands

This commit is contained in:
2022-09-29 11:23:15 +02:00
parent 07b48087b4
commit 5be326d56a
11 changed files with 11 additions and 2 deletions

View File

@@ -17,6 +17,7 @@ module.exports = {
.setRequired(true) .setRequired(true)
.setAutocomplete(true) .setAutocomplete(true)
), ),
permissionLevel: 0,
async execute(interaction) { async execute(interaction) {
await interaction.deferReply(); await interaction.deferReply();

View File

@@ -9,6 +9,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("collection") .setName("collection")
.setDescription("List all cards in your collection"), .setDescription("List all cards in your collection"),
permissionLevel: 0,
async execute(interaction) { async execute(interaction) {
let user = await UserUtils.getUserByDiscordId(interaction.member.id); let user = await UserUtils.getUserByDiscordId(interaction.member.id);
let offset = 0; let offset = 0;

View File

@@ -7,6 +7,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("cooldowns") .setName("cooldowns")
.setDescription("List cooldowns"), .setDescription("List cooldowns"),
permissionLevel: 0,
async execute(interaction) { async execute(interaction) {
//fetch the user given the userID and include his cards //fetch the user given the userID and include his cards
const user = await UserUtils.getUserByDiscordId(interaction.member.id); const user = await UserUtils.getUserByDiscordId(interaction.member.id);

View File

@@ -4,7 +4,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("debugrendering") .setName("debugrendering")
.setDescription("Debug rendering"), .setDescription("Debug rendering"),
permissionLevel: 1, permissionLevel: 2,
async execute(interaction) { async execute(interaction) {
const image = await sharp({ const image = await sharp({

View File

@@ -9,7 +9,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("drop") .setName("drop")
.setDescription("Drop a card"), .setDescription("Drop a card"),
permissionLevel: 0,
async execute(interaction) { async execute(interaction) {
await interaction.deferReply(); await interaction.deferReply();
const user = await UserUtils.getUserByDiscordId(interaction.member.id); const user = await UserUtils.getUserByDiscordId(interaction.member.id);

View File

@@ -9,6 +9,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("editprofile") .setName("editprofile")
.setDescription("Edit your profile"), .setDescription("Edit your profile"),
permissionLevel: 0,
async execute(interaction) { async execute(interaction) {
let user = await UserUtils.getUserByDiscordId(interaction.member.id); let user = await UserUtils.getUserByDiscordId(interaction.member.id);

View File

@@ -19,6 +19,7 @@ module.exports = {
.setDescription("View someone else's profile") .setDescription("View someone else's profile")
.setRequired(false) .setRequired(false)
), ),
permissionLevel: 0,
async execute(interaction) { async execute(interaction) {
await interaction.reply({ files:[ 'https://cdn.discordapp.com/attachments/856904078754971658/1019009533470842930/rendering-placeholder.gif']}); await interaction.reply({ files:[ 'https://cdn.discordapp.com/attachments/856904078754971658/1019009533470842930/rendering-placeholder.gif']});

View File

@@ -6,6 +6,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("register") .setName("register")
.setDescription("Register yourself"), .setDescription("Register yourself"),
permissionLevel: 0,
async execute(interaction) { async execute(interaction) {
let user = await User.findOne({ let user = await User.findOne({
where: { where: {

View File

@@ -11,6 +11,7 @@ module.exports = {
.setDescription("View someone else's stats") .setDescription("View someone else's stats")
.setRequired(false) .setRequired(false)
), ),
permissionLevel: 0,
async execute(interaction) { async execute(interaction) {
await interaction.deferReply(); await interaction.deferReply();
let discordUser = interaction.options.getUser("user") ? interaction.options.getUser("user") : interaction.member.user; let discordUser = interaction.options.getUser("user") ? interaction.options.getUser("user") : interaction.member.user;

View File

@@ -6,6 +6,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("userlist") .setName("userlist")
.setDescription("List all users"), .setDescription("List all users"),
permissionLevel: 2,
async execute(interaction) { async execute(interaction) {
let users = await User.findAll(); let users = await User.findAll();
let userList = ""; let userList = "";

View File

@@ -28,6 +28,7 @@ module.exports = {
.setRequired(true) .setRequired(true)
.setAutocomplete(true) .setAutocomplete(true)
), ),
permissionLevel: 0,
async execute(interaction) { async execute(interaction) {
await interaction.deferReply(); await interaction.deferReply();