diff options
| author | Adelyn Breelove <[email protected]> | 2019-02-13 12:21:19 -0700 |
|---|---|---|
| committer | Adelyn Breelove <[email protected]> | 2019-02-13 12:21:19 -0700 |
| commit | f241545b6e9a46fc0482ab66db4d9bbdf44cae4f (patch) | |
| tree | 6f68fc345b566154aa1d7393472ea1b6ad0f38d6 /bin/commands.ml | |
| parent | Update test bot (diff) | |
| download | disml-f241545b6e9a46fc0482ab66db4d9bbdf44cae4f.tar.xz disml-f241545b6e9a46fc0482ab66db4d9bbdf44cae4f.zip | |
Change api of the set_status methods
Diffstat (limited to 'bin/commands.ml')
| -rw-r--r-- | bin/commands.ml | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/bin/commands.ml b/bin/commands.ml index ab3a76e..131925a 100644 --- a/bin/commands.ml +++ b/bin/commands.ml @@ -54,9 +54,9 @@ let embed message _args = (* Set the status of all shards to a given string. *) let status message args = - let status = List.fold ~init:"" ~f:(fun a v -> a ^ " " ^ v) args in + let name = List.fold ~init:"" ~f:(fun a v -> a ^ " " ^ v) args in Ivar.read client >>> fun client -> - Client.set_status ~status:(`String status) client + Client.set_status ~name client >>> fun _ -> Message.reply message "Updated status" >>> ignore @@ -87,14 +87,19 @@ let cache message _args = let pre = U.length cache.presences in let user = Option.(value ~default:"None" (cache.user >>| User.tag)) in let embed = Embed.(default - |> description (Printf.sprintf "Guilds: %d\nText Channels: %d\nVoice Channels: %d\nCategories: %d\nGroups: %d\nPrivate Channels: %d\nUsers: %d\nPresences: %d\nCurrent User: %s" gc tc vc cs gr pr uc pre user)) in + |> description (Printf.sprintf + "Guilds: %d\nText Channels: %d\n\ + Voice Channels: %d\nCategories: %d\n\ + Groups: %d\nPrivate Channels: %d\n\ + Users: %d\nPresences: %d\n\ + Current User: %s" + gc tc vc cs gr pr uc pre user)) in Message.reply_with ~embed message >>> ignore -(* Issue a shutdown to all shards. It is expected that they will restart if `?restart` is not false. *) +(* Issue a shutdown to all shards, then exits the process. *) let shutdown _message _args = - let module Sharder = Gateway.Sharder in - Ivar.read client >>> fun client -> - Sharder.shutdown_all client.sharder >>> ignore + Ivar.read client >>= Client.shutdown_all ~restart:false >>> fun _ -> + exit 0 (* Request guild members to be sent over the gateway for the guild the command is run in. This will cause multiple GUILD_MEMBERS_CHUNK events. *) let request_members (message:Message.t) _args = |