Change sacrifice command embed colours to go green when successful from red #237
3 changed files with 22 additions and 6 deletions
|
@ -24,6 +24,11 @@ export default class Sacrifice extends ButtonEvent {
|
||||||
const userId = interaction.customId.split(" ")[2];
|
const userId = interaction.customId.split(" ")[2];
|
||||||
const cardNumber = interaction.customId.split(" ")[3];
|
const cardNumber = interaction.customId.split(" ")[3];
|
||||||
|
|
||||||
|
if (userId != interaction.user.id) {
|
||||||
|
await interaction.reply("Only the user who created this sacrifice can confirm it.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const cardInInventory = await Inventory.FetchOneByCardNumberAndUserId(userId, cardNumber);
|
const cardInInventory = await Inventory.FetchOneByCardNumberAndUserId(userId, cardNumber);
|
||||||
|
|
||||||
if (!cardInInventory) {
|
if (!cardInInventory) {
|
||||||
|
@ -67,8 +72,8 @@ export default class Sacrifice extends ButtonEvent {
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle("Card Sacrificed")
|
.setTitle("Card Sacrificed")
|
||||||
.setDescription(description.join("\n"))
|
.setDescription(description.join("\n"))
|
||||||
.setColor(EmbedColours.Ok)
|
.setColor(EmbedColours.Green)
|
||||||
.setFooter({ text: `${interaction.user.username} · ${cardData.card.name}` });
|
.setFooter({ text: `${interaction.user.username}` });
|
||||||
|
|
||||||
const row = new ActionRowBuilder<ButtonBuilder>()
|
const row = new ActionRowBuilder<ButtonBuilder>()
|
||||||
.addComponents([
|
.addComponents([
|
||||||
|
@ -94,6 +99,11 @@ export default class Sacrifice extends ButtonEvent {
|
||||||
const userId = interaction.customId.split(" ")[2];
|
const userId = interaction.customId.split(" ")[2];
|
||||||
const cardNumber = interaction.customId.split(" ")[3];
|
const cardNumber = interaction.customId.split(" ")[3];
|
||||||
|
|
||||||
|
if (userId != interaction.user.id) {
|
||||||
|
await interaction.reply("Only the user who created this sacrifice can cancel it.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const cardInInventory = await Inventory.FetchOneByCardNumberAndUserId(userId, cardNumber);
|
const cardInInventory = await Inventory.FetchOneByCardNumberAndUserId(userId, cardNumber);
|
||||||
|
|
||||||
if (!cardInInventory) {
|
if (!cardInInventory) {
|
||||||
|
@ -122,8 +132,8 @@ export default class Sacrifice extends ButtonEvent {
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle("Sacrifice Cancelled")
|
.setTitle("Sacrifice Cancelled")
|
||||||
.setDescription(description.join("\n"))
|
.setDescription(description.join("\n"))
|
||||||
.setColor(EmbedColours.Error)
|
.setColor(EmbedColours.Grey)
|
||||||
.setFooter({ text: `${interaction.user.username} · ${cardData.card.name}` });
|
.setFooter({ text: `${interaction.user.username}` });
|
||||||
|
|
||||||
const row = new ActionRowBuilder<ButtonBuilder>()
|
const row = new ActionRowBuilder<ButtonBuilder>()
|
||||||
.addComponents([
|
.addComponents([
|
||||||
|
|
|
@ -50,8 +50,8 @@ export default class Sacrifice extends Command {
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle("Sacrifice")
|
.setTitle("Sacrifice")
|
||||||
.setDescription(description.join("\n"))
|
.setDescription(description.join("\n"))
|
||||||
.setColor(EmbedColours.Grey)
|
.setColor(EmbedColours.Error)
|
||||||
.setFooter({ text: `${interaction.user.username} · ${cardData.card.name}` });
|
.setFooter({ text: `${interaction.user.username}` });
|
||||||
|
|
||||||
const row = new ActionRowBuilder<ButtonBuilder>()
|
const row = new ActionRowBuilder<ButtonBuilder>()
|
||||||
.addComponents([
|
.addComponents([
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
export default class EmbedColours {
|
export default class EmbedColours {
|
||||||
|
// General
|
||||||
public static readonly Ok = 0x3050ba;
|
public static readonly Ok = 0x3050ba;
|
||||||
public static readonly Success = 0x50c878;
|
public static readonly Success = 0x50c878;
|
||||||
public static readonly Error = 0xff0000;
|
public static readonly Error = 0xff0000;
|
||||||
|
|
||||||
|
// Colours
|
||||||
public static readonly Grey = 0xd3d3d3;
|
public static readonly Grey = 0xd3d3d3;
|
||||||
|
public static readonly Green = 0x228B22;
|
||||||
|
|
||||||
|
// Card Types
|
||||||
public static readonly BronzeCard = 0xcd7f32;
|
public static readonly BronzeCard = 0xcd7f32;
|
||||||
public static readonly SilverCard = 0xc0c0c0;
|
public static readonly SilverCard = 0xc0c0c0;
|
||||||
public static readonly GoldCard = 0xffd700;
|
public static readonly GoldCard = 0xffd700;
|
||||||
|
|
Loading…
Reference in a new issue