aboutsummaryrefslogtreecommitdiff
path: root/tests/test_user.rs
Commit message (Collapse)AuthorAgeFilesLines
* Break up the model moduleZeyla Hellyer2017-12-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `model` module has historically been one giant module re-exporting all of the model types, which is somewhere around 100 types. This can be a lot to look at for a new user and somewhat overwhelming, especially with a large number of fine-grained imports from the module. The module is now neatly split up into submodules, mostly like it has been internally since the early versions of the library. The submodules are: - application - channel - error - event - gateway - guild - id - invite - misc - permissions - prelude - user - voice - webhook Each submodule contains types that are "owned" by the module. For example, the `guild` submodule contains, but not limited to, Emoji, AuditLogsEntry, Role, and Member. `channel` contains, but not limited to, Attachment, Embed, Message, and Reaction. Upgrade path: Instead of glob importing the models via `use serenity::model::*;`, instead glob import via the prelude: ```rust use serenity::model::prelude::*; ``` Instead of importing from the root model module: ```rust use serenity::model::{Guild, Message, OnlineStatus, Role, User}; ``` instead import from the submodules like so: ```rust use serenity::model::channel::Message; use serenity::model::guild::{Guild, Role}; use serenity::model::user::{OnlineStatus, User}; ```
* `to_owned` -> `to_string`acdenisSK2017-10-091-3/+3
|
* Apply rustfmtZeyla Hellyer2017-09-181-12/+20
|
* Apply rustfmtZeyla Hellyer2017-08-181-20/+12
|
* Change the config a bit, and a few nitpicksacdenisSK2017-07-271-12/+20
|
* rustfmtacdenisSK2017-07-271-5/+13
|
* Fix no-feature testsZeyla Hellyer2017-06-241-36/+39
|
* Deprecate *User::distinct, add *User::tagZeyla Hellyer2017-06-011-0/+2
| | | | | | | | | | `distinct`, although accurate, is an odd name for the method. Deprecate `distinct` on `CurrentUser` and `User` and rename them to `tag`. Additionally, optimize the creation of the resultant String by about 2x. Instead of using the `format!` macro, create a new String with a capacity of 37 and push the username, `'#'`, and write the discriminator in manually.
* Make `User.discriminator` a u16Zeyla Hellyer2017-04-251-11/+11
| | | | | | | | | Change the User struct's `discriminator` field to a u16 for performance. The User struct's `discriminator` field was previously a u16 but changed to a `String` for ease-of-use. Lately the library has been gearing more towards performance where possible while not sacrificing ergonomics _too much_ in most scenarios.
* Use CDN for default avatarsAustin Hellyer2017-01-091-5/+5
|
* Add User::default_avatar_url() methodAustin Hellyer2017-01-081-0/+16
|
* Add user static avatar url methodsAustin Hellyer2016-12-281-0/+2
|
* Support webp/gif avatarsAustin Hellyer2016-12-281-2/+4
| | | | | If the avatar hash begins with "a_", then the avatar is animated and is a GIF. Otherwise, use WEBP.
* Fix User::avatar_url + add Id display testsAustin Hellyer2016-12-151-0/+24
User::avatar_url was formatting the user's Id as a mention, rather than the inner u64.