gift reason

This commit is contained in:
Axel Olausson Holtenäs 2022-03-06 14:58:46 +01:00
parent b57794e5a1
commit 5cf3138c53
No known key found for this signature in database
GPG key ID: E3AE7E194AE017ED
2 changed files with 5 additions and 3 deletions

View file

@ -9,6 +9,7 @@ module.exports = async (interaction) => {
try {
const user = await interaction.options.getUser('user');
const amount = await interaction.options.getInteger('amount');
const reason = await interaction.options.getString('reason');
const data = await credits.findOne({ userId: interaction.user.id, guildId: interaction.member.guild.id });
if (user.id === interaction.user.id) {
@ -62,7 +63,7 @@ module.exports = async (interaction) => {
const interactionEmbed = {
title: 'Gift',
description: `You sent ${creditNoun(amount)} to ${user}. Your new balance is ${creditNoun(
description: `You sent ${creditNoun(amount)} to ${user}${reason ? ` with reason: ${reason}` : ''}. Your new balance is ${creditNoun(
fromUser.balance,
)}.`,
color: 0x22bb33,
@ -71,7 +72,7 @@ module.exports = async (interaction) => {
};
const dmEmbed = {
title: 'Gift',
description: `You recieved ${creditNoun(amount)} from ${interaction.user}. Your new balance is ${creditNoun(
description: `You recieved ${creditNoun(amount)} from ${interaction.user}${reason ? ` with reason: ${reason}` : ''}. Your new balance is ${creditNoun(
toUser.balance,
)}.`,
color: 0x22bb33,

View file

@ -52,7 +52,8 @@ module.exports = {
.setName('gift')
.setDescription('Gift someone credits from your credits.')
.addUserOption((option) => option.setName('user').setDescription('The user you want to pay.').setRequired(true))
.addIntegerOption((option) => option.setName('amount').setDescription('The amount you will pay.').setRequired(true)))
.addIntegerOption((option) => option.setName('amount').setDescription('The amount you will pay.').setRequired(true))
.addStringOption((option) => option.setName('reason').setDescription('Your reason.')))
.addSubcommand((subcommand) => subcommand.setName('top').setDescription('Check the top balance.'))
.addSubcommand((subcommand) => subcommand
.setName('transfer')