File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export default async function guild(
11
11
guildStr : string ,
12
12
userId : number ,
13
13
) {
14
- const guild = _ . lowerCase ( guildStr ) ;
14
+ const guild = _ . toLower ( guildStr ) ;
15
15
if ( isGuild ( guild ) ) {
16
16
updateUsersStash ( userId , { guild } ) ;
17
17
const user = getUserStash ( userId ) ;
Original file line number Diff line number Diff line change
1
+ import _ from "lodash" ;
2
+
1
3
import type { TextCtxType } from "../../common/types" ;
2
4
import { isSport } from "../../common/validators" ;
3
5
import { conversationPhase } from "../../common/variables" ;
@@ -6,12 +8,13 @@ import { updateEntryStash } from "../../entries";
6
8
// eslint-disable-next-line @typescript-eslint/no-explicit-any
7
9
export default async function sport (
8
10
ctx : TextCtxType ,
9
- text : string ,
11
+ sportStr : string ,
10
12
chatId : number ,
11
13
) {
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 } ?` ) ;
15
18
conversationPhase . set ( chatId , "dist" ) ;
16
19
} else {
17
20
await ctx . reply ( "Please give a proper sport" ) ;
You can’t perform that action at this time.
0 commit comments