Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | import { LOCALIZATION_ADAPTER, NestedLocalizationAdapter } from "@necord/localization"; import { Inject, Injectable } from "@nestjs/common"; import { ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js"; @Injectable() export class Buttons { public constructor(@Inject(LOCALIZATION_ADAPTER) private readonly translate: NestedLocalizationAdapter) {} public async Confirm(locale: string): Promise<ActionRowBuilder<ButtonBuilder>> { return new ActionRowBuilder<ButtonBuilder>().addComponents([ new ButtonBuilder() .setCustomId("confirm/yes") .setLabel(this.translate.getTranslation("Tools.Buttons.Labels.Confirm.YES", locale)) .setEmoji("719710630881525881") .setStyle(ButtonStyle.Success), new ButtonBuilder() .setCustomId("confirm/no") .setLabel(this.translate.getTranslation("Tools.Buttons.Labels.Confirm.NO", locale)) .setEmoji("719710607405875321") .setStyle(ButtonStyle.Danger), ]); } } export enum ConfirmButtonEnum { Yes = "tes", No = "no", } |