aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAdelyn Breedlove <[email protected]>2019-01-28 07:41:20 -0700
committerAdelyn Breedlove <[email protected]>2019-01-28 07:41:20 -0700
commite48af10e04a4aea4eb72dac58b83fc7cc080e1bd (patch)
tree78a0cf1f78855982ea54c78ac36f7fd89c5a1122 /bin
parentSwitch to ID abstractions internally (diff)
downloaddisml-e48af10e04a4aea4eb72dac58b83fc7cc080e1bd.tar.xz
disml-e48af10e04a4aea4eb72dac58b83fc7cc080e1bd.zip
Fix Message.t.mentions
Diffstat (limited to 'bin')
-rw-r--r--bin/bot.ml7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/bot.ml b/bin/bot.ml
index f7f0869..fd20db5 100644
--- a/bin/bot.ml
+++ b/bin/bot.ml
@@ -64,6 +64,13 @@ let check_command (Event.MessageCreate.{message}) =
| "!test" ->
let ch = `Channel_id 377716501446393856 in
Channel_id.say "Testing..." ch >>> ignore
+ | "!echo" ->
+ let `Message_id id = message.id in
+ let id = Option.((List.hd rest >>| Int.of_string) |> value ~default:id) in
+ Channel_id.get_message ~id message.channel_id >>> begin function
+ | Ok msg -> Message.reply message (Printf.sprintf "```lisp\n%s```" (Message.sexp_of_t msg |> Sexp.to_string_hum)) >>> ignore
+ | _ -> ()
+ end
| _ -> ()
let setup_logger () =