32 lines
836 B
JavaScript
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)] })
|
|
})
|
|
}
|
|
}
|