Add trade command #172

Merged
Vylpes merged 4 commits from feature/165-trade-command into develop 2024-02-23 18:37:48 +00:00
2 changed files with 46 additions and 4 deletions
Showing only changes of commit 339ec575c8 - Show all commits

View file

@ -1,4 +1,4 @@
import { ButtonInteraction, EmbedBuilder } from "discord.js"; import { ActionRowBuilder, ButtonBuilder, ButtonInteraction, ButtonStyle, EmbedBuilder } from "discord.js";
import { ButtonEvent } from "../type/buttonEvent"; import { ButtonEvent } from "../type/buttonEvent";
import { CoreClient } from "../client/client"; import { CoreClient } from "../client/client";
import Inventory from "../database/entities/app/Inventory"; import Inventory from "../database/entities/app/Inventory";
@ -114,7 +114,21 @@ export default class Trade extends ButtonEvent {
} }
]); ]);
await interaction.update({ embeds: [ tradeEmbed ]}); const row = new ActionRowBuilder<ButtonBuilder>()
.addComponents([
new ButtonBuilder()
.setCustomId("trade expired accept")
.setLabel("Accept")
.setStyle(ButtonStyle.Success)
.setDisabled(true),
new ButtonBuilder()
.setCustomId("trade expired decline")
.setLabel("Decline")
.setStyle(ButtonStyle.Danger)
.setDisabled(true),
]);
await interaction.update({ embeds: [ tradeEmbed ], components: [ row ]});
} }
private async DeclineTrade(interaction: ButtonInteraction) { private async DeclineTrade(interaction: ButtonInteraction) {
@ -169,6 +183,20 @@ export default class Trade extends ButtonEvent {
} }
]); ]);
await interaction.update({ embeds: [ tradeEmbed ]}); const row = new ActionRowBuilder<ButtonBuilder>()
.addComponents([
new ButtonBuilder()
.setCustomId("trade expired accept")
.setLabel("Accept")
.setStyle(ButtonStyle.Success)
.setDisabled(true),
new ButtonBuilder()
.setCustomId("trade expired decline")
.setLabel("Decline")
.setStyle(ButtonStyle.Danger)
.setDisabled(true),
]);
await interaction.update({ embeds: [ tradeEmbed ], components: [ row ]});
} }
} }

View file

@ -122,6 +122,20 @@ export default class Trade extends Command {
} }
]); ]);
await interaction.editReply({ embeds: [ tradeEmbed ]}); const row = new ActionRowBuilder<ButtonBuilder>()
.addComponents([
new ButtonBuilder()
.setCustomId("trade expired accept")
.setLabel("Accept")
.setStyle(ButtonStyle.Success)
.setDisabled(true),
new ButtonBuilder()
.setCustomId("trade expired declined")
.setLabel("Decline")
.setStyle(ButtonStyle.Danger)
.setDisabled(true),
]);
await interaction.editReply({ embeds: [ tradeEmbed ], components: [ row ]});
} }
} }