elevate-discord-bot/disabled/giveloss.js
2023-05-21 16:27:56 +01:00

32 lines
836 B
JavaScript

import { giveLoss } from "../ranked/profile.js"
import Command from "../base/Command.js";
import MessageHelper from "../base/MessageHelper.js";
export default class GiveLoss extends Command {
constructor (client) {
super(client, {
name: "giveloss",
description: "Gives a player a loss.",
options: [
{
name: "player",
description: "The player that will recieve the loss.",
required: true,
type: "USER"
}
]
});
}
run (interaction) {
const target = interaction.options.get("player").value
giveLoss(target)
.then(() => {
interaction.editReply({ embeds: [MessageHelper.success("A loss has been added.")] })
})
.catch(err => {
interaction.editReply({ embeds: [MessageHelper.error(err)] })
})
}
}