aboutsummaryrefslogtreecommitdiff
path: root/lib/channel.atd
diff options
context:
space:
mode:
Diffstat (limited to 'lib/channel.atd')
-rw-r--r--lib/channel.atd79
1 files changed, 79 insertions, 0 deletions
diff --git a/lib/channel.atd b/lib/channel.atd
new file mode 100644
index 0000000..4094ff1
--- /dev/null
+++ b/lib/channel.atd
@@ -0,0 +1,79 @@
+type snowflake <ocaml from="Snowflake" t="t"> = abstract
+type user <ocaml from="User" t="t"> = abstract
+
+type group = {
+ id: snowflake;
+ ?last_message_id: snowflake option;
+ ?last_pin_timestamp: string option;
+ ?icon: string option;
+ ?name: string option;
+ owner_id: snowflake;
+ recipients: user list;
+}
+
+type dm = {
+ id: snowflake;
+ ?last_message_id: snowflake option;
+ ?last_pin_timestamp: string option;
+}
+
+type guild_text = {
+ id: snowflake;
+ ?last_message_id: snowflake option;
+ ?last_pin_timestamp: string option;
+ ?category_id <json name="parent_id">: snowflake option;
+ guild_id: snowflake;
+ name: string;
+ position: int;
+ ?topic: string option;
+ nsfw: bool;
+ ?slow_mode_timeout <json name="rate_limit_per_user">: int option;
+}
+
+type guild_voice = {
+ id: snowflake;
+ ?category_id <json name="parent_id">: snowflake option;
+ guild_id: snowflake;
+ name: string;
+ position: int;
+ ?topic: string option;
+ nsfw: bool;
+ ?user_limit: int option;
+ ?bitrate: int option;
+}
+
+type category = {
+ id: snowflake;
+ ?category_id <json name="parent_id">: snowflake option;
+ position: int;
+ name: string;
+ nsfw: bool;
+}
+
+type t = [
+ Group of group
+ | Private of dm
+ | GuildText of guild_text
+ | GuildVoice of guild_voice
+ | Category of category
+]
+
+type channel_wrapper = {
+ id: snowflake;
+ kind <json name="type">: int;
+ ?guild_id: snowflake option;
+ ?position: int option;
+ ?name: string option;
+ ?topic: string option;
+ ?nsfw: bool option;
+ ?last_message_id: snowflake option;
+ ?bitrate: int option;
+ ?user_limit: int option;
+ ?rate_limit_per_user: int option;
+ ?recipients: user list option;
+ ?icon: string option;
+ ?owner_id: snowflake option;
+ ?application_id: snowflake option;
+ ?category_id <json name="parent_id">: snowflake option;
+ ?last_pin_timestamp: string option;
+} \ No newline at end of file