Skip to content

Commit

Permalink
Each command should also take in a connection string
Browse files Browse the repository at this point in the history
  • Loading branch information
arnavb committed Jul 17, 2024
1 parent f153a3b commit 3fa8345
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion JimBroBot/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ let findAndExecuteCommand (name: string, socketSlashCommand: SocketSlashCommand)
task {
match commands |> List.tryFind (fun elem -> fst elem = name) with
| Some(_, (_, commandResponder)) ->
do! commandResponder socketSlashCommand
do! commandResponder socketSlashCommand connectionString
return Ok()
| None -> return Error MissingCommandHandler
}
Expand Down
8 changes: 4 additions & 4 deletions JimBroBot/UserCommands.fs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let addExerciseBuilder name =
choices = Array.empty
)

let addExerciseResponder (command: SocketSlashCommand) =
let addExerciseResponder (command: SocketSlashCommand) connectionString =
let user = command.User
let allOptions = command.Data.Options |> List.ofSeq |> List.map _.Value

Expand Down Expand Up @@ -214,7 +214,7 @@ let logTimeHelper (command: SocketSlashCommand) (options: obj list) =
}


let logExerciseResponder (command: SocketSlashCommand) =
let logExerciseResponder (command: SocketSlashCommand) connectionString =
let user = command.User

let allOptions = command.Data.Options |> List.ofSeq
Expand All @@ -238,15 +238,15 @@ let undoExerciseBuilder name =
.WithName(name)
.WithDescription("Undo most recent exercise entry")

let undoExerciseResponder (command: SocketSlashCommand) =
let undoExerciseResponder (command: SocketSlashCommand) connectionString =
task { do! command.RespondAsync "Done!" }

let profileBuilder name =
(new SlashCommandBuilder())
.WithName(name)
.WithDescription("View bot user profile")

let profileResponder (command: SocketSlashCommand) =
let profileResponder (command: SocketSlashCommand) connectionString =
task {
do! command.DeferAsync()

Expand Down

0 comments on commit 3fa8345

Please sign in to comment.