Disable buttons on press
This commit is contained in:
parent
ef795efd28
commit
339ec575c8
2 changed files with 46 additions and 4 deletions
|
@ -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 { CoreClient } from "../client/client";
|
||||
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) {
|
||||
|
@ -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 ]});
|
||||
}
|
||||
}
|
|
@ -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 ]});
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue