oysteikt/wiki-math-bot
oysteikt
/
wiki-math-bot
Archived
1
0
Fork 0
This repository has been archived on 2024-07-04. You can view files and clone it, but cannot push or open issues or pull requests.
wiki-math-bot/src/Bot/BotCommands.fs

28 lines
920 B
Forth
Raw Normal View History

2021-03-26 19:39:28 +01:00
namespace Bot
module BotCommands =
open System.Threading.Tasks
open DSharpPlus.CommandsNext
open DSharpPlus.CommandsNext.Attributes
open Channels
type BotCommands() =
[<Command("hi")>]
member public self.hi(ctx:CommandContext) =
async { ctx.RespondAsync "Hi there" |> ignore } |> Async.StartAsTask :> Task
[<Command("echo")>]
member public self.echo(ctx:CommandContext) (message:string) =
async { ctx.RespondAsync message |> ignore } |> Async.StartAsTask :> Task
[<Command("toggle")>]
member public self.toggle(ctx:CommandContext) =
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
} |> Async.StartAsTask :> Task