Add logger to toggle command
This commit is contained in:
parent
30500e18d9
commit
73938e0bad
|
@ -7,6 +7,7 @@ module BotCommands =
|
||||||
open DSharpPlus.CommandsNext.Attributes
|
open DSharpPlus.CommandsNext.Attributes
|
||||||
|
|
||||||
open Channels
|
open Channels
|
||||||
|
open Logging
|
||||||
|
|
||||||
type BotCommands() =
|
type BotCommands() =
|
||||||
[<Command("hi")>]
|
[<Command("hi")>]
|
||||||
|
@ -19,10 +20,15 @@ module BotCommands =
|
||||||
|
|
||||||
[<Command("toggle")>]
|
[<Command("toggle")>]
|
||||||
member public self.toggle(ctx:CommandContext) =
|
member public self.toggle(ctx:CommandContext) =
|
||||||
|
log <| sprintf "!toggle from %A" ctx.Channel.Id
|
||||||
async {
|
async {
|
||||||
toggleChannel ctx.Channel.Id
|
toggleChannel ctx.Channel.Id
|
||||||
|> fun channelGotAdded ->
|
|> fun channelGotAdded ->
|
||||||
match channelGotAdded with
|
match channelGotAdded with
|
||||||
| true -> ctx.RespondAsync "This is now my channel :)" |> ignore
|
| true ->
|
||||||
| false -> ctx.RespondAsync "This is now your channel (:" |> ignore
|
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
|
} |> Async.StartAsTask :> Task
|
||||||
|
|
Reference in New Issue