This commit is contained in:
parent
05ba8c4b8e
commit
daaa55cd72
3 changed files with 13 additions and 13 deletions
|
@ -23,7 +23,7 @@ const requiredConfigs: string[] = [
|
|||
"DB_SYNC",
|
||||
"DB_LOGGING",
|
||||
"EXPRESS_PORT",
|
||||
]
|
||||
];
|
||||
|
||||
requiredConfigs.forEach(config => {
|
||||
if (!process.env[config]) {
|
||||
|
|
|
@ -10,41 +10,41 @@ export default class Give extends Command {
|
|||
super();
|
||||
|
||||
this.CommandBuilder = new SlashCommandBuilder()
|
||||
.setName('give')
|
||||
.setDescription('Give a user a card manually, in case bot breaks')
|
||||
.setName("give")
|
||||
.setDescription("Give a user a card manually, in case bot breaks")
|
||||
.setDefaultMemberPermissions(PermissionsBitField.Flags.Administrator)
|
||||
.addStringOption(x =>
|
||||
x
|
||||
.setName('cardnumber')
|
||||
.setDescription('G')
|
||||
.setName("cardnumber")
|
||||
.setDescription("G")
|
||||
.setRequired(true))
|
||||
.addUserOption(x =>
|
||||
x
|
||||
.setName('user')
|
||||
.setName("user")
|
||||
.setDescription("The user to give the card to")
|
||||
.setRequired(true));
|
||||
}
|
||||
|
||||
public override async execute(interaction: CommandInteraction<CacheType>) {
|
||||
if (!CoreClient.AllowDrops) {
|
||||
await interaction.reply('Bot is currently syncing, please wait until its done.');
|
||||
await interaction.reply("Bot is currently syncing, please wait until its done.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (await Config.GetValue('safemode') == "true") {
|
||||
await interaction.reply('Safe Mode has been activated, please resync to continue.');
|
||||
if (await Config.GetValue("safemode") == "true") {
|
||||
await interaction.reply("Safe Mode has been activated, please resync to continue.");
|
||||
return;
|
||||
}
|
||||
|
||||
const whitelistedUsers = process.env.BOT_ADMINS!.split(',');
|
||||
const whitelistedUsers = process.env.BOT_ADMINS!.split(",");
|
||||
|
||||
if (!whitelistedUsers.find(x => x == interaction.user.id)) {
|
||||
await interaction.reply("Only whitelisted users can use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
const cardNumber = interaction.options.get('cardnumber', true);
|
||||
const user = interaction.options.getUser('user', true);
|
||||
const cardNumber = interaction.options.get("cardnumber", true);
|
||||
const user = interaction.options.getUser("user", true);
|
||||
|
||||
const card = CardDropHelperMetadata.GetCardByCardNumber(cardNumber.value!.toString());
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ export default class CardDropHelperMetadata {
|
|||
return card;
|
||||
}
|
||||
|
||||
public static GenerateDropEmbed(drop: DropResult, quantityClaimed: Number, imageFileName: string): EmbedBuilder {
|
||||
public static GenerateDropEmbed(drop: DropResult, quantityClaimed: number, imageFileName: string): EmbedBuilder {
|
||||
let description = "";
|
||||
description += `Series: ${drop.series.name}\n`;
|
||||
description += `Claimed: ${quantityClaimed}\n`;
|
||||
|
|
Loading…
Reference in a new issue