diff --git a/API/client-server/v1/servers/[serverId]/channels/[channelId]/messages.md b/API/client-server/v1/servers/[serverId]/channels/[channelId]/messages.md new file mode 100644 index 0000000..80123d1 --- /dev/null +++ b/API/client-server/v1/servers/[serverId]/channels/[channelId]/messages.md @@ -0,0 +1,28 @@ +#### GET /v1/servers/{serverId}/channels/{channelId}/messages +Retrieves all [[Message|messages]] in a [[Guild]]. +##### Responses + +| Status | Description | +| ------ | --------------------------------------------------------- | +| 200 | The request succeeded and the message object is returned. | +| 400 | The post request included poorly formated data. | +| 401 | User is not authenticated. | +| 403 | User does not have permission to view the message. | +| 500 | An unhandled error occurred. | + +###### 200 +Returns a [[Message]] object. +#### GET /v1/servers/{serverId}/channels/{channelId}/messages/{messageId} +Retrieves a [[Message]] from a channel. +##### Responses + +| Status | Description | +| ------ | --------------------------------------------------------- | +| 200 | The request succeeded and the message object is returned. | +| 400 | The post request included poorly formated data. | +| 401 | User is not authenticated. | +| 403 | User does not have permission to view the message. | +| 500 | An unhandled error occurred. | + +###### 200 +Returns a [[Message]] object. \ No newline at end of file diff --git a/API/models/Channel.md b/API/models/Channel.md new file mode 100644 index 0000000..48ad0db --- /dev/null +++ b/API/models/Channel.md @@ -0,0 +1,9 @@ +## Channel Object +Represents a channel in a [[Guild#Guild Object|Guild]]. + +**Structure** + +| Field | Type | Description | +| ----- | ------ | ------------------- | +| id | string | ID of the channel | +| name | string | Name of the channel | diff --git a/API/models/Emoji.md b/API/models/Emoji.md new file mode 100644 index 0000000..542fd42 --- /dev/null +++ b/API/models/Emoji.md @@ -0,0 +1,9 @@ +## Emoji Object +Represents an emoji in a [[Guild]]. + +**Structure** + +| Field | Type | Description | +| ----- | ------ | ----------------- | +| id | string | ID of the emoji | +| name | string | Name of the emoji | diff --git a/API/models/Guild.md b/API/models/Guild.md new file mode 100644 index 0000000..7c6df95 --- /dev/null +++ b/API/models/Guild.md @@ -0,0 +1,25 @@ +## Guild Object +Represents a guild in an [[Instance]]. + +**Structure** + +| Field | Type | Description | +| ------------ | ---------------------------------------------- | ------------------------------ | +| id | string | ID of the guild | +| description | string | Description of the guild | +| name | string | Name of the guild | +| icon | string | URL for the icon | +| owner_id | string | ID of the owner | +| roles | array of [[#Role Object\|Role]] objects | Roles in the guild | +| emojis | array of [[Emoji#Emoji Object\|Emoji]] objects | Emojis in the guild | +| member_count | integer | Number of members in the guild | + +### Role Object +**Structure** + +| Field | Type | Description | +| ----- | ------ | ----------------------- | +| id | string | ID of the role | +| name | string | Name of the role | +| icon | string | URL for the role's icon | + diff --git a/API/models/Instance.md b/API/models/Instance.md new file mode 100644 index 0000000..3af1e5b --- /dev/null +++ b/API/models/Instance.md @@ -0,0 +1,15 @@ +# We will probably have/need this right? +## Message Object +Represents a Gorb instance. + +**Structure** + +| Field | Type | Description | +| ------------ | ---------------------------------------------- | ----------------------------------------------------- | +| id | string | ID of the instance | +| name | string | Name of the instance | +| accounts | integer | Number of accounts registered on the instance | +| uptime | integer | Seconds since the instance was last started | +| version | string | The version of Gorb that the instance is running | +| build_number | string | The build number of Gorb that the instance is running | +| guilds | array of [[Guild#Guild Object\|Guild]] objects | Guilds in the instance | diff --git a/API/models/Message.md b/API/models/Message.md new file mode 100644 index 0000000..6948c91 --- /dev/null +++ b/API/models/Message.md @@ -0,0 +1,88 @@ +## Message Object +Represents a message in a [[Channel]]/DM. + +**Structure** + +| Field | Type | Description | +| ----------- | --------------------------------------------------- | ----------------------------------------------- | +| id | string | ID of the message | +| channel_id | string | ID of the channel the message was sent it | +| author | [[User]] object | Author of the message | +| content | string | Content of the message | +| created_at | timestamp | When the message was sent | +| edited | timestamp \| null | When this message was edited, null if it hasn't | +| attachments | array of [[#Attachment Object\|Attachment]] objects | Files attached with the message, empty if none | +| embeds | array of [[#Embed Object\|Embed]] objects | Embeds sent with the message, empty if none | +**Example Message** +```json +{ + "id": "aa077418-c9e3-4703-bdd7-8187f230192c", + "channel_id": "b61aebb9-0463-47cb-b007-c0940ada962b", + "author": { + "uuid": "26c8037c-2c35-4c0f-9504-35df82a1effc", + "username": "sauceyred", + "display_name": "💜The Sauce🔥", + "created_at": "1746115074928" + }, + "content": "heyo what's going on", + "created_at": "1746110781000", + "edited": null, + "attachments": [], + "embeds": [] +} +``` + +## Embed Object +Represents an embed in a [[#Message Object|Message]]. + +**Structure** + +| Field | Type | Description | +| ------ | ----------------------------------------- | ------------------- | +| title | string | Title of the embed | +| color | integer | Color of the embed | +| fields | array of [[#Field Object\|Field]] objects | Fields of the embed | + +**Example Embed** +```json +{ + "title": "SauceyRed's Profile", + "color": 6572758, + "fields": [ + { "name": "Username", value: "sauceyred" }, + { "name": "Height", value: "159" }, + { "name": "" } + ] +} +``` +### Field Object +Represents a field in an [[#Embed Object|Embed]]. +**Structure** + +| Field | Type | Description | +| ------ | ------- | ----------------------------------------------------- | +| name | string | Name of the field | +| value | string | Value of the field | +| inline | boolean | Whether field is displayed inline, default is `false` | +**Example Field** +```json +{ + "name": "Username", + "value": "sauceyred" +} +``` +## Attachment Object +Represents an attachment in a [[#Message Object|Message]]. + +**Structure** + +| Field | Type | Description | +| ----- | ---- | ----------- | +| | | | + +**Example Attachment** +```json +{ + "": "" +} +``` \ No newline at end of file diff --git a/API/models/User.md b/API/models/User.md new file mode 100644 index 0000000..5ba40ef --- /dev/null +++ b/API/models/User.md @@ -0,0 +1,10 @@ +Represents a user of an [[Instance]]. + +**Structure** + +| Field | Type | Description | +| ------------ | --------- | ------------------------- | +| uuid | string | ID of the user | +| username | string | Username of the user | +| display_name | string | Display name of the user | +| created_at | timestamp | When the user was created |