Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
FirezTheGreat committed Oct 22, 2022
1 parent 5bb17bc commit f5e660f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
13 changes: 7 additions & 6 deletions commands/moderation/force.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,12 @@ module.exports = class Force extends Command {

const embedMessage = await interaction.guild.channels.cache.get(Channels.ScreenshotVerificationId).messages.fetch(match.message_id);

embedMessage.embeds[0].fields = [
{ name: GameSides[GameTheme][0], value: match.coalition.players.map((player, index) => index === 0 ? `${player.name} (C)` : player.name).join('\n'), inline: true },
{ name: GameSides[GameTheme][1], value: match.breach.players.map((player, index) => index === 0 ? `${player.name} (C)` : player.name).join('\n'), inline: true },
{ name: 'Host', value: match.host.name, inline: true }
];
embedMessage.embeds[0] = new EmbedBuilder.from(embedMessage.embeds[0])
.setFields(
{ name: GameSides[GameTheme][0], value: match.coalition.players.map((player, index) => index === 0 ? `${player.name} (C)` : player.name).join('\n'), inline: true },
{ name: GameSides[GameTheme][1], value: match.breach.players.map((player, index) => index === 0 ? `${player.name} (C)` : player.name).join('\n'), inline: true },
{ name: 'Host', value: match.host.name, inline: true }
);

const replace_embed = new EmbedBuilder()
.setAuthor({ name: interaction.guild.name, iconURL: interaction.guild.iconURL() })
Expand All @@ -359,7 +360,7 @@ module.exports = class Force extends Command {
.setFooter({ text: `Moderator - ${interaction.user.username}`, iconURL: interaction.user.displayAvatarURL() })
.setTimestamp();

await embedMessage.edit({ embeds: [embedMessage] });
await embedMessage.edit({ embeds: [embedMessage.embeds[0]] });
return await interaction.editReply({ embeds: [replace_embed] });
} else if (sub_command === 'team') {

Expand Down
6 changes: 3 additions & 3 deletions commands/utility/submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ module.exports = class Submit extends Command {
.setFooter({ text: 'Senior Moderators have verified the screenshot!', iconURL: interaction.guild.iconURL() })

const new_message = await this.bot.utils.auditSend(Channels.VerifiedScreenshotId, { embeds: [submit_embed] });
message.deletable ? await message.delete() : null;
message.deletable ? message.delete().catch(() => null) : null;

await MatchStats.updateOne(
{ id: code },
Expand All @@ -144,10 +144,10 @@ module.exports = class Submit extends Command {
}
);

return submit_message.deletable ? await submit_message.delete() : null;
return submit_message.deletable ? submit_message.delete().catch(() => null) : null;
});
} else {
return submit_message.deletable ? await submit_message.delete() : null;
return submit_message.deletable ? submit_message.delete().catch(() => null) : null;
};
} catch (error) {
console.error(error);
Expand Down

0 comments on commit f5e660f

Please sign in to comment.