diff options
| author | Adelyn Breelove <[email protected]> | 2019-02-11 16:28:08 -0700 |
|---|---|---|
| committer | Adelyn Breelove <[email protected]> | 2019-02-11 16:28:08 -0700 |
| commit | 891be029358c97403505b5c62faaeb881db5c60e (patch) | |
| tree | d57908bcc45a7ff2f3595e22076af93a124e2b9a /bin | |
| parent | Realized I should bump the version (diff) | |
| download | disml-891be029358c97403505b5c62faaeb881db5c60e.tar.xz disml-891be029358c97403505b5c62faaeb881db5c60e.zip | |
Random useless command in the test bot
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/bot.ml | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -71,7 +71,10 @@ let check_command (message:Message.t) = 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
+ | Ok msg ->
+ let str = Message.sexp_of_t msg |> Sexp.to_string_hum in
+ print_endline str;
+ Message.reply message (Printf.sprintf "```lisp\n%s```" str) >>> ignore
| _ -> ()
end
| "!cache" -> (* Output cache counts as a a basic embed. *)
@@ -99,6 +102,17 @@ let check_command (message:Message.t) = (match message.guild_id with
| Some guild -> Client.request_guild_members ~guild client >>> ignore
| None -> ())
+ | "!rep" ->
+ let input = Option.(List.hd rest |> value ~default:"a") in
+ let list = List.(range 0 2000 >>| (fun _ -> input) |> fold ~init:"" ~f:(^)) in
+ Message.reply message list >>= begin function
+ | Ok m ->
+ String.length m.content
+ |> Int.to_string
+ |> (^) "Bytes: "
+ |> Message.reply m
+ | Error e -> Message.reply message (Error.to_string_hum e)
+ end >>> ignore
| "!new" -> (* Creates a guild named testing *)
Guild.create [ "name", `String "testing" ] >>= begin function
| Ok _ -> Message.reply message "Guild created"
|