improve user experience
This commit is contained in:
parent
d19a3af6a3
commit
6b1eb44fad
1 changed files with 3 additions and 14 deletions
|
@ -34,18 +34,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {
|
||||||
await getEmbedData(interaction.guild);
|
await getEmbedData(interaction.guild);
|
||||||
const { options, guild, user, client } = interaction;
|
const { options, guild, user, client } = interaction;
|
||||||
const optionAmount = options?.getInteger("amount");
|
const optionAmount = options?.getInteger("amount");
|
||||||
if (optionAmount === null) {
|
if (optionAmount === null) throw new Error("Can't find a valid amount specified!");
|
||||||
logger?.silly(`Amount is null.`);
|
|
||||||
const interactionEmbed = new EmbedBuilder()
|
|
||||||
.setTitle("[:dollar:] Gift")
|
|
||||||
.setDescription("We could not read your requested amount.")
|
|
||||||
.setTimestamp()
|
|
||||||
.setColor(errorColor)
|
|
||||||
.setFooter({ text: footerText, iconURL: footerIcon });
|
|
||||||
return interaction?.editReply({
|
|
||||||
embeds: [interactionEmbed],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (!guild) throw new Error("Guild not found");
|
if (!guild) throw new Error("Guild not found");
|
||||||
|
|
||||||
const upsertguildMemberCredit = await prisma.guildMemberCredit.upsert({
|
const upsertguildMemberCredit = await prisma.guildMemberCredit.upsert({
|
||||||
|
@ -174,7 +163,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {
|
||||||
|
|
||||||
if (!interaction.guild) throw new Error("Guild is undefined");
|
if (!interaction.guild) throw new Error("Guild is undefined");
|
||||||
const dmEmbed = new EmbedBuilder()
|
const dmEmbed = new EmbedBuilder()
|
||||||
.setTitle("[:shopping_cart:] CPGG")
|
.setTitle(":shopping_cart:︱CPGG")
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`This voucher comes from **${interaction.guild.name}**.`
|
`This voucher comes from **${interaction.guild.name}**.`
|
||||||
)
|
)
|
||||||
|
@ -193,7 +182,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {
|
||||||
})
|
})
|
||||||
.then(async (msg: Message) => {
|
.then(async (msg: Message) => {
|
||||||
const interactionEmbed = new EmbedBuilder()
|
const interactionEmbed = new EmbedBuilder()
|
||||||
.setTitle("[:shopping_cart:] CPGG")
|
.setTitle(":shopping_cart:︱CPGG")
|
||||||
.setDescription(`I have sent you the code in [DM](${msg.url})!`)
|
.setDescription(`I have sent you the code in [DM](${msg.url})!`)
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setColor(successColor)
|
.setColor(successColor)
|
||||||
|
|
Loading…
Add table
Reference in a new issue