Commit 73938e0b authored by Øystein Kristoffer Tveit's avatar Øystein Kristoffer Tveit 💻
Browse files

Add logger to toggle command

parent 30500e18
......@@ -7,6 +7,7 @@ module BotCommands =
open DSharpPlus.CommandsNext.Attributes
open Channels
open Logging
type BotCommands() =
[<Command("hi")>]
......@@ -19,10 +20,15 @@ module BotCommands =
[<Command("toggle")>]
member public self.toggle(ctx:CommandContext) =
log <| sprintf "!toggle from %A" ctx.Channel.Id
async {
toggleChannel ctx.Channel.Id
|> fun channelGotAdded ->
match channelGotAdded with
| true -> ctx.RespondAsync "This is now my channel :)" |> ignore
| false -> ctx.RespondAsync "This is now your channel (:" |> ignore
| true ->
log <| sprintf "Added %A to list of channels " ctx.Channel.Id
ctx.RespondAsync "This is now my channel :)" |> ignore
| false ->
log <| sprintf "Removed %A from list of channels " ctx.Channel.Id
ctx.RespondAsync "This is now your channel (:" |> ignore
} |> Async.StartAsTask :> Task
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment