diff options
| author | Adelyn Breedlove <[email protected]> | 2019-01-28 07:41:20 -0700 |
|---|---|---|
| committer | Adelyn Breedlove <[email protected]> | 2019-01-28 07:41:20 -0700 |
| commit | e48af10e04a4aea4eb72dac58b83fc7cc080e1bd (patch) | |
| tree | 78a0cf1f78855982ea54c78ac36f7fd89c5a1122 /bin | |
| parent | Switch to ID abstractions internally (diff) | |
| download | disml-e48af10e04a4aea4eb72dac58b83fc7cc080e1bd.tar.xz disml-e48af10e04a4aea4eb72dac58b83fc7cc080e1bd.zip | |
Fix Message.t.mentions
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/bot.ml | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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 () = |