Custom: Prevent dropping and burning of custom cards

This commit is contained in:
2023-04-01 15:26:02 +02:00
parent 35917db0d0
commit 46f2bc377f
3 changed files with 9 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
const { SlashCommandBuilder, AttachmentBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, ComponentType } = require("discord.js");
const { Card, User, Group, Character } = require("../models");
const { QUALITY_VALUES, QUALITY_NAMES, CURRENCY_SYMBOLS } = require("../config/constants");
const { QUALITY_VALUES, QUALITY_NAMES, CURRENCY_SYMBOLS, PATREON } = require("../config/constants");
const { UserUtils } = require("../util");
const fs = require("fs");
const edit = require("./edit");
@@ -42,6 +42,10 @@ module.exports = {
interaction.editReply({ content: "This card is already burned" });
return;
}
if (card.Character.Group.id == PATREON.customsGID) {
interaction.editReply({ content: "Custom cards can't be burned" });
return;
}
const embed = new EmbedBuilder()
.setTitle(`${interaction.member.displayName} burned ${card.identifier}`)

View File

@@ -2,7 +2,7 @@ const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, Compo
const { Card, User, Character, DropHistory, Wishlist, sequelize } = require("../models");
const { customAlphabet } = require("nanoid");
const { CardUtils, UserUtils, ReplyUtils, GeneralUtils, Rendering } = require("../util");
const { QUALITY } = require("../config/constants");
const { QUALITY, PATREON } = require("../config/constants");
const Sequelize = require('sequelize');
const card = require("../models/card");
@@ -33,7 +33,8 @@ module.exports = {
const cards = [];
let characters = await Character.findAll({
where: {
enabled: true
enabled: true,
groupId: { [Sequelize.Op.not] : PATREON.customsGID }
},
order: sequelize.random(),
limit: 3

View File

@@ -70,6 +70,7 @@ const DAILY_REWARDS = {
const PATREON = {
roleServer : '441300798819794944',
customsGID : 4,
tiers : {
1 : {
modifiers: {