From 21d4cd6e6a5cdf2d8d90bcb71beb7f4ee952dfb8 Mon Sep 17 00:00:00 2001 From: R3T4RD3D Date: Tue, 11 Apr 2017 17:06:45 +0200 Subject: [PATCH 1/3] Add documentation to user class --- docs/types/USER.md | 83 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 docs/types/USER.md diff --git a/docs/types/USER.md b/docs/types/USER.md new file mode 100644 index 0000000..562014b --- /dev/null +++ b/docs/types/USER.md @@ -0,0 +1,83 @@ +# User + +## User + +Represents the user object. + +### Attributes + +Name | Type | Description +---- | ---- | ----------- +`id` | `snowflake` | The ID of this user +`username` | `str` | The name of the user +`avatar` | `str` | The user's avatar hash +`discriminator` | `str` | The user's discriminator (4-digit discord-tag) +`bot` | `bool` | Whether this user is a bot +`verified` | `bool` | Whether the email on this account has been verified +`email` | `str` | The user's email address + +### Properties + +#### default\_avatar + +Retruns the Default (colored discord logo) avatar URL of the user. + +#### avatar\_url + +Returns the avatar URL of the user. + +#### mention + +Returns a formated string that mentions the user. + +### Methods + +#### get\_avatar\_url(`fmt='webp'`, `size=1024`) + +Returns the URL of the user's avatar in a specific format and size. + +##### Arguments: +Name | Type | Description +---- | ---- | ----------- +`fmt` | `str` | Imageformat of the avatar +`size` | `int` | Size of the avatar + +## Presence + +Represents the Presence of a user. + +### Attributes + +Name | Type | Description +---- | ---- | ----------- +`user` | [User](USER.md) | +`game` | [Game](USER.md) | The user's current activity +`status` | `Status`(enum) | The user's current status + +## Game + +Represents the activity of a user. + +### Attributes + +Name | Type | Description +---- | ---- | ----------- +`type` | `GameType`(enum) | Whether the user is just playing the game or streaming it. +`name` | `str` | Name of the game +`url` | Stream URL. Only validated when `GameType` is `STREAMING`. + +## Enums + +User specific Enumerations + +### Status + + * `ONLINE` + * `IDLE` + * `DND` (Do not Disturb) + * `OFFLINE` + +### GameType + + * `DEFAULT` (Playing ...) + * `STREAMING` (Streaming ...) From a3e22765b7749fd2edbb949c985efee37da7bff5 Mon Sep 17 00:00:00 2001 From: R3T4RD3D Date: Tue, 11 Apr 2017 18:56:40 +0200 Subject: [PATCH 2/3] Add missing table item --- docs/types/USER.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/types/USER.md b/docs/types/USER.md index 562014b..3abe0fb 100644 --- a/docs/types/USER.md +++ b/docs/types/USER.md @@ -64,7 +64,7 @@ Name | Type | Description ---- | ---- | ----------- `type` | `GameType`(enum) | Whether the user is just playing the game or streaming it. `name` | `str` | Name of the game -`url` | Stream URL. Only validated when `GameType` is `STREAMING`. +`url` | `str` | Stream URL. Only validated when `GameType` is `STREAMING`. ## Enums From 154e1d8507051e4fb8ef145c82011069581d58c3 Mon Sep 17 00:00:00 2001 From: R3T4RD3D Date: Tue, 11 Apr 2017 19:10:31 +0200 Subject: [PATCH 3/3] Fix links --- docs/types/USER.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/types/USER.md b/docs/types/USER.md index 3abe0fb..9895976 100644 --- a/docs/types/USER.md +++ b/docs/types/USER.md @@ -50,9 +50,9 @@ Represents the Presence of a user. Name | Type | Description ---- | ---- | ----------- -`user` | [User](USER.md) | -`game` | [Game](USER.md) | The user's current activity -`status` | `Status`(enum) | The user's current status +`user` | [User](USER.md#user-1) | +`game` | [Game](USER.md#game) | The user's current activity +`status` | [Status](USER.md#status)(enum) | The user's current status ## Game @@ -62,7 +62,7 @@ Represents the activity of a user. Name | Type | Description ---- | ---- | ----------- -`type` | `GameType`(enum) | Whether the user is just playing the game or streaming it. +`type` | [GameType](USER.md#gametype)(enum) | Whether the user is just playing the game or streaming it. `name` | `str` | Name of the game `url` | `str` | Stream URL. Only validated when `GameType` is `STREAMING`.