Hotfix 2.2

Hug and headpat should be working now
This commit is contained in:
ZyLacx 2022-02-12 15:05:59 +01:00
parent 3968836758
commit b74bac9ee7
3 changed files with 10 additions and 20 deletions

View file

@ -11,15 +11,8 @@ module.exports = {
options.setName('who') options.setName('who')
.setDescription('Is for me? c:')), .setDescription('Is for me? c:')),
async execute(interaction) { async execute(interaction) {
const resultTuple = await headpat(interaction); const embed = await headpat(interaction);
const embed = resultTuple[1];
if (resultTuple[0] == null) {
interaction.reply({ embeds: [embed] }); interaction.reply({ embeds: [embed] });
}
else {
const msgContent = resultTuple[0];
interaction.reply({ content: msgContent, embeds: [embed] });
}
}, },
}; };

View file

@ -11,15 +11,8 @@ module.exports = {
options.setName('who') options.setName('who')
.setDescription('It\'s not me.. is it? :c')), .setDescription('It\'s not me.. is it? :c')),
async execute(interaction) { async execute(interaction) {
const resultTuple = await hug(interaction); const embed = await hug(interaction);
const embed = resultTuple[1];
if (resultTuple[0] == null) {
interaction.reply({ embeds: [embed] }); interaction.reply({ embeds: [embed] });
}
else {
const msgContent = resultTuple[0];
interaction.reply({ content: msgContent, embeds: [embed] });
}
}, },
}; };

View file

@ -46,12 +46,16 @@ async function getGifEmbed(gifQuery, gifAmount) {
async function getGifWithMessage(interaction, gifQuery, gifAmount) { async function getGifWithMessage(interaction, gifQuery, gifAmount) {
const gifEmbed = getGifEmbed(gifQuery, gifAmount); const gifEmbed = getGifEmbed(gifQuery, gifAmount);
let who;
try { try {
return (interaction.user.username + ' headpats ' + interaction.options.getMentionable('who'), gifEmbed); who = interaction.options.getMentionable('who');
} }
catch { catch {
return (null, gifEmbed); return gifEmbed;
} }
(await gifEmbed).setDescription(interaction.user.username
+ ` ${interaction.commandName}s ` + `${who}`);
return gifEmbed;
} }
async function returnPromiseString(guildMembers) { async function returnPromiseString(guildMembers) {