This commit is contained in:
powermaker450 2024-10-21 12:37:40 -04:00
parent e24b163a34
commit 31cb503bc1
2 changed files with 7 additions and 9 deletions

View file

@ -140,7 +140,6 @@ export async function execute(interaction: ChatInputCommandInteraction) {
let idHead = "\n" + heading("Confessions:", HeadingLevel.Two); let idHead = "\n" + heading("Confessions:", HeadingLevel.Two);
let idCount = false; let idCount = false;
for (const member of bannedMembers) { for (const member of bannedMembers) {
if (member.method === BanReason.ByUser) { if (member.method === BanReason.ByUser) {
userHead += "\n" + `<@${member.user}>`; userHead += "\n" + `<@${member.user}>`;
userCount = true; userCount = true;
@ -155,11 +154,9 @@ export async function execute(interaction: ChatInputCommandInteraction) {
if (userCount && idCount) { if (userCount && idCount) {
return userHead + idHead; return userHead + idHead;
} else { } else {
return userCount return userCount ? userHead : idHead;
? userHead
: idHead;
} }
} };
try { try {
return interaction.reply({ return interaction.reply({

View file

@ -287,10 +287,11 @@ export class StoreMan {
for (const guild of this.data) { for (const guild of this.data) {
if (guild.id === guildId) { if (guild.id === guildId) {
// Only add the user to the ban list if they aren't banned already // Only add the user to the ban list if they aren't banned already
!this.isBannedByUser(guildId, userId) && guild.settings.bans.push({ !this.isBannedByUser(guildId, userId) &&
user: userId, guild.settings.bans.push({
method: BanReason.ByUser user: userId,
}); method: BanReason.ByUser
});
this.saveFile(); this.saveFile();
return true; return true;