-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0af578f
commit 85cce24
Showing
6 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import {makePacket, PacketContext} from "../../../../Lib/src/packets/DraftBotPacket"; | ||
import {CommandRarityPacketReq, CommandRarityPacketRes} from "../../../../Lib/src/packets/commands/CommandRarityPacket"; | ||
import {DiscordCache} from "../../bot/DiscordCache"; | ||
import i18n from "../../translations/i18n"; | ||
import {DraftBotEmbed} from "../../messages/DraftBotEmbed"; | ||
import {SlashCommandBuilderGenerator} from "../SlashCommandBuilderGenerator"; | ||
import {ICommand} from "../ICommand"; | ||
|
||
function getPacket(): CommandRarityPacketReq { | ||
return makePacket(CommandRarityPacketReq, {}); | ||
} | ||
|
||
export async function handleCommandRarityPacketRes(packet: CommandRarityPacketRes, context: PacketContext): Promise<void> { | ||
const interaction = DiscordCache.getInteraction(context.discord!.interaction); | ||
|
||
if (interaction) { | ||
await interaction.reply({ | ||
embeds: [new DraftBotEmbed() | ||
.setTitle(i18n.t("commands:rarity.title", { | ||
lng: interaction.channel.language | ||
} | ||
)) | ||
.setDescription(i18n.t("commands:rarity.rarities", { | ||
common: packet.common, | ||
uncommon: packet.uncommon, | ||
exotic: packet.exotic, | ||
rare: packet.rare, | ||
special: packet.special, | ||
epic: packet.epic, | ||
legendary: packet.legendary, | ||
unique: packet.unique, | ||
lng: interaction.channel.language | ||
}))] | ||
}); | ||
} | ||
} | ||
|
||
export const commandInfo: ICommand = { | ||
slashCommandBuilder: SlashCommandBuilderGenerator.generateBaseCommand("rarity"), | ||
getPacket, | ||
requirements: {}, | ||
mainGuildCommand: false | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters