Added permission levels to all commands
This commit is contained in:
@@ -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();
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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({
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -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']});
|
||||||
|
|
||||||
|
|||||||
@@ -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: {
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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 = "";
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user