Skip to content

Commit 51685ee

Browse files
committed
added pluralize
1 parent be65d84 commit 51685ee

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/commandDetails/admin/ban.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from '../../codeyCommand';
99
import { banUser } from '../../components/admin';
1010
import { vars } from '../../config';
11+
import { pluralize } from '../../utils/pluralize';
1112

1213
// Ban a user
1314
const banExecuteCommand: SapphireMessageExecuteType = async (client, messageFromUser, args) => {
@@ -35,7 +36,7 @@ const banExecuteCommand: SapphireMessageExecuteType = async (client, messageFrom
3536
const guild = await client.guilds.fetch(vars.TARGET_GUILD_ID);
3637
if (await banUser(guild, user, reason, days)) {
3738
return `Successfully banned user ${user.tag} (id: ${user.id}) ${
38-
days ? `and deleted their messages in the past ${days} days ` : ``
39+
days ? `and deleted their messages in the past ${days} ${pluralize('day', days)} ` : ``
3940
}for the following reason: ${reason}`;
4041
} else {
4142
throw new CodeyUserError(

src/components/admin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const MOD_USER_ID_FOR_BAN_APPEAL: string = vars.MOD_USER_ID_FOR_BAN_APPEAL;
99
const makeBanMessage = (reason: string, days?: number): string =>
1010
`
1111
Uh oh, you have been banned from the UW Computer Science Club server ${
12-
days && `and your messages in the past ${days} ${pluralize('day', days)} have been deleted `
12+
days ? `and your messages in the past ${days} ${pluralize('day', days)} have been deleted `: ''
1313
}for the following reason:
1414
1515
> ${reason}

0 commit comments

Comments
 (0)