Skip to content

Commit 7072e14

Browse files
committed
Fix issues with special characters
1 parent 256bfd4 commit 7072e14

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/commands/text/guild.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default async function guild(
1111
guildStr: string,
1212
userId: number,
1313
) {
14-
const guild = _.lowerCase(guildStr);
14+
const guild = _.toLower(guildStr);
1515
if (isGuild(guild)) {
1616
updateUsersStash(userId, { guild });
1717
const user = getUserStash(userId);

src/commands/text/sport.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import _ from "lodash";
2+
13
import type { TextCtxType } from "../../common/types";
24
import { isSport } from "../../common/validators";
35
import { conversationPhase } from "../../common/variables";
@@ -6,12 +8,13 @@ import { updateEntryStash } from "../../entries";
68
// eslint-disable-next-line @typescript-eslint/no-explicit-any
79
export default async function sport(
810
ctx: TextCtxType,
9-
text: string,
11+
sportStr: string,
1012
chatId: number,
1113
) {
12-
if (isSport(text)) {
13-
updateEntryStash(chatId, { sport: text });
14-
await ctx.reply(`What distance (km) did you ${text}?`);
14+
const sport = _.toLower(sportStr);
15+
if (isSport(sport)) {
16+
updateEntryStash(chatId, { sport: sport });
17+
await ctx.reply(`What distance (km) did you ${sport}?`);
1518
conversationPhase.set(chatId, "dist");
1619
} else {
1720
await ctx.reply("Please give a proper sport");

0 commit comments

Comments
 (0)