Debug: Add command to alter a users experience
Also added the option to pass a user mention instead of an id as the extUser parameter.
This commit is contained in:
@@ -12,17 +12,44 @@ module.exports = {
|
|||||||
.setName("feature")
|
.setName("feature")
|
||||||
.setDescription("The command to debug")
|
.setDescription("The command to debug")
|
||||||
.setRequired(false)
|
.setRequired(false)
|
||||||
|
.addChoices(
|
||||||
|
{ name: 'ping', value: 'ping' },
|
||||||
|
{ name: 'ids', value: 'ids' },
|
||||||
|
{ name: 'clear_cards', value: 'clear_cards' },
|
||||||
|
{ name: 'cooldowns', value: 'cooldowns' },
|
||||||
|
{ name: 'bot', value: 'bot' },
|
||||||
|
{ name: 'reset_cd', value: 'reset_cd' },
|
||||||
|
{ name: 'add_xp', value: 'add_xp' },
|
||||||
|
)
|
||||||
)
|
)
|
||||||
.addStringOption((option) =>
|
.addStringOption((option) =>
|
||||||
option
|
option
|
||||||
.setName("userid")
|
.setName("userid")
|
||||||
.setDescription("Discord ID")
|
.setDescription("Discord ID")
|
||||||
.setRequired(false)
|
.setRequired(false)
|
||||||
|
)
|
||||||
|
.addUserOption((option) =>
|
||||||
|
option
|
||||||
|
.setName("user")
|
||||||
|
.setDescription("Discord User")
|
||||||
|
.setRequired(false)
|
||||||
|
)
|
||||||
|
.addStringOption((option) =>
|
||||||
|
option
|
||||||
|
.setName("value")
|
||||||
|
.setDescription("some value")
|
||||||
|
.setRequired(false)
|
||||||
),
|
),
|
||||||
permissionLevel: 2,
|
permissionLevel: 2,
|
||||||
async execute(interaction) {
|
async execute(interaction) {
|
||||||
const identifier = CardUtils.generateIdentifier();
|
const identifier = CardUtils.generateIdentifier();
|
||||||
let user = await UserUtils.getUserByDiscordId(interaction.member.id);
|
let user = await UserUtils.getUserByDiscordId(interaction.member.id);
|
||||||
|
let extUser;
|
||||||
|
if(interaction.options.getUser("user")) {
|
||||||
|
extUser = await UserUtils.getUserByDiscordId(interaction.options.getUser("user").id);
|
||||||
|
} else if(interaction.options.getString("userid")) {
|
||||||
|
extUser = await UserUtils.getUserByDiscordId(interaction.options.getString("userid"));
|
||||||
|
}
|
||||||
switch (interaction.options.getString("feature")) {
|
switch (interaction.options.getString("feature")) {
|
||||||
case "ping":
|
case "ping":
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
@@ -69,7 +96,6 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "reset_cd":
|
case "reset_cd":
|
||||||
let extUser = await UserUtils.getUserByDiscordId(interaction.options.getString("userid"));
|
|
||||||
await UserUtils.setCooldown(extUser, "pull", 1);
|
await UserUtils.setCooldown(extUser, "pull", 1);
|
||||||
await UserUtils.setCooldown(extUser, "drop", 1);
|
await UserUtils.setCooldown(extUser, "drop", 1);
|
||||||
await UserUtils.setCooldown(extUser, "daily", 1);
|
await UserUtils.setCooldown(extUser, "daily", 1);
|
||||||
@@ -78,6 +104,13 @@ module.exports = {
|
|||||||
ephemeral: false
|
ephemeral: false
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case "add_xp":
|
||||||
|
await extUser.addExperience(interaction.options.getString("value"))
|
||||||
|
interaction.reply({
|
||||||
|
content: `Added ${interaction.options.getString("value")} XP to <@${extUser.discordId}>`,
|
||||||
|
ephemeral: false
|
||||||
|
});
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
content: `Your permission level is ${await UserUtils.getPermissionLevel(interaction.member)}`,
|
content: `Your permission level is ${await UserUtils.getPermissionLevel(interaction.member)}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user