Custom: Prevent dropping and burning of custom cards
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
const { SlashCommandBuilder, AttachmentBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, ComponentType } = require("discord.js");
|
const { SlashCommandBuilder, AttachmentBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, ComponentType } = require("discord.js");
|
||||||
const { Card, User, Group, Character } = require("../models");
|
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 { UserUtils } = require("../util");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const edit = require("./edit");
|
const edit = require("./edit");
|
||||||
@@ -42,6 +42,10 @@ module.exports = {
|
|||||||
interaction.editReply({ content: "This card is already burned" });
|
interaction.editReply({ content: "This card is already burned" });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (card.Character.Group.id == PATREON.customsGID) {
|
||||||
|
interaction.editReply({ content: "Custom cards can't be burned" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle(`${interaction.member.displayName} burned ${card.identifier}`)
|
.setTitle(`${interaction.member.displayName} burned ${card.identifier}`)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, Compo
|
|||||||
const { Card, User, Character, DropHistory, Wishlist, sequelize } = require("../models");
|
const { Card, User, Character, DropHistory, Wishlist, sequelize } = require("../models");
|
||||||
const { customAlphabet } = require("nanoid");
|
const { customAlphabet } = require("nanoid");
|
||||||
const { CardUtils, UserUtils, ReplyUtils, GeneralUtils, Rendering } = require("../util");
|
const { CardUtils, UserUtils, ReplyUtils, GeneralUtils, Rendering } = require("../util");
|
||||||
const { QUALITY } = require("../config/constants");
|
const { QUALITY, PATREON } = require("../config/constants");
|
||||||
const Sequelize = require('sequelize');
|
const Sequelize = require('sequelize');
|
||||||
const card = require("../models/card");
|
const card = require("../models/card");
|
||||||
|
|
||||||
@@ -33,7 +33,8 @@ module.exports = {
|
|||||||
const cards = [];
|
const cards = [];
|
||||||
let characters = await Character.findAll({
|
let characters = await Character.findAll({
|
||||||
where: {
|
where: {
|
||||||
enabled: true
|
enabled: true,
|
||||||
|
groupId: { [Sequelize.Op.not] : PATREON.customsGID }
|
||||||
},
|
},
|
||||||
order: sequelize.random(),
|
order: sequelize.random(),
|
||||||
limit: 3
|
limit: 3
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ const DAILY_REWARDS = {
|
|||||||
|
|
||||||
const PATREON = {
|
const PATREON = {
|
||||||
roleServer : '441300798819794944',
|
roleServer : '441300798819794944',
|
||||||
|
customsGID : 4,
|
||||||
tiers : {
|
tiers : {
|
||||||
1 : {
|
1 : {
|
||||||
modifiers: {
|
modifiers: {
|
||||||
|
|||||||
Reference in New Issue
Block a user