aboutsummaryrefslogtreecommitdiff
path: root/src/model
Commit message (Collapse)AuthorAgeFilesLines
* Add `impl AsRef<MessageId> for Message`asref_messageid_for_messageMishio5952018-07-241-0/+6
|
* Fix some clippy lintsZeyla Hellyer2018-07-158-55/+54
| | | | | Some lints were not resolved due to causing API changes. Most lints in the framework were left unfixed.
* typosZeyla Hellyer2018-07-141-2/+2
|
* Abstract impls in Channel's Mentionable implZeyla Hellyer2018-07-141-4/+4
| | | | | Abstract the implementations for each of Channel's variants' `Mentionable` implementations by using the underlying impl.
* Implement Mentionable for GroupZeyla Hellyer2018-07-141-0/+6
|
* Implement Mentionable for PrivateChannelZeyla Hellyer2018-07-141-0/+6
|
* Implement Mentionable for ChannelCategoryZeyla Hellyer2018-07-141-1/+7
|
* Fix doc links with no anchorZeyla Hellyer2018-07-112-0/+7
|
* impl Mentionable for GuildChannel (#348)Adelyn2018-07-101-0/+4
|
* Deprecate Message::guild_id()Zeyla Hellyer2018-07-091-14/+11
| | | | | Instead, using the structfield is preferred, since that comes from gateway events directly now anyway.
* Add a message cache API (#345)zeyla2018-07-091-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds an API for message caching. By default this caches 0 messages per channel. This can be customized when instantiating: ```rust use serenity::cache::{Cache, Settings}; let mut settings = Settings::new(); // Cache 10 messages per channel. settings.max_messages(10); let cache = Cache::new_with_settings(settings); ``` After instantiation: ```rust use serenity::cache::Cache; let mut cache = Cache::new(); cache.settings_mut().max_messages(10); ``` And during runtime through the global cache: ```rust use serenity::CACHE; CACHE.write().settings_mut().max_messages(10); ```
* impl Form<&$ID> for $IDZeyla Hellyer2018-07-081-0/+6
| | | | Implements `From<&Id>` for all `Id` types, e.g. `From<&RoleId> for RoleId`.
* Monomorphize all functionsZeyla Hellyer2018-07-0411-56/+279
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit monomorphizes all functions, turning functions like: ```rust fn foo<T: Into<Bar>>(baz: T) { baz = baz.into(); // function here } ``` Into functions like: ```rust fn foo<T: Into<Bar>>(baz: T) { _foo(baz.into()) } fn _foo(baz: Bar) { // function here } ``` This avoids binary bloat and improves build times, by reducing the amount of code duplication.
* Fix dead doc-links and add missing ones. (#347)Lakelezz2018-07-041-33/+40
|
* Make guild optional on InvitesZeyla Hellyer2018-06-271-8/+20
| | | | | | | | Make the `guild` structfield on `Invite` and `RichInvite` optional. This was done due to a change in the [docs]. [docs]: https://github.com/discordapp/discord-api-docs/commit/bc0a15bd11db72644633080903171fbc3e71b026
* feature: add guild_id to Message, per g250k changesChristopher F2018-06-171-0/+5
| | | | | | this allows stateless bots to drop the need for a channel->guild mapping (cherry picked from commit 74bb8fa5a3b4b5fd43559866b4627bf09484f6ae)
* Remove extraneous spaces at the end of linesZeyla Hellyer2018-06-177-16/+16
|
* Add methods to check whether `Message` is mentioning `User` (#323)Lakelezz2018-05-291-0/+15
|
* Remove deadlocking in Member::highest_role_infoZeyla Hellyer2018-05-271-8/+6
| | | | | | Instead of calling `parking_lot::RwLock::read` on the member's guild, call `parking_lot::RwLock::try_read` and return None early if it would cause a deadlock.
* impl From<{,&'a }CurrentUser> for UserZeyla Hellyer2018-05-231-0/+24
| | | | | Implementation `From<CurrentUser> for User` and `From<&'a CurrentUser> for User`.
* Implement Mentionable for CurrentUserZeyla Hellyer2018-05-231-0/+6
|
* Add `Message::member` structfieldZeyla Hellyer2018-05-212-2/+23
| | | | | Adds the `Message::member` structfield, which contains a partial amount of member data (deaf and mute status, role IDs, and joined_at).
* Fix "Guild Member Chunk" deserializationZeyla Hellyer2018-04-251-2/+11
|
* Remove empty whitespace at ends of linesZeyla Hellyer2018-04-251-1/+1
|
* Get rid of a spurious import warningacdenisSK2018-04-201-4/+3
|
* make `Options`'s fields optional (#305)Kyle Clemens2018-04-121-15/+60
|
* Turn the number-like properties of `Options` into `u64`acdenisSK2018-04-111-38/+45
|
* Handle (de)serializing `target_id` from/to a stringacdenisSK2018-04-111-2/+37
|
* Fix nsfw related docs (#299)Lakelezz2018-04-044-15/+15
|
* Refactor imports/exports to use nested groups and better formattingacdenisSK2018-03-2914-30/+107
|
* Change the way ids and some enums are made (#295)Leah2018-03-237-172/+271
| | | | | This makes them easier to be found by tools like rls. Also update struct inits to use the shorthand version for `x: x`.
* Remove useless clones (#292)Maiddog2018-03-172-4/+4
|
* Support sending files with an embed (#285)Brandon Lucier2018-03-041-5/+4
|
* Pad user discriminators in content_safe to 4 digitsMegumi Sonoda2018-02-231-1/+1
| | | | This brings the function in line with the 'tag' function for User models, and with the official Discord app experience and other libraries.
* Add 'Get Guild Vanity Url' endpointZeyla Hellyer2018-02-093-0/+30
| | | | Docs: <https://github.com/discordapp/discord-api-docs/commit/98f6643703012d2f3780ba730ce1191120f85dcd>
* Fix broken docs links caused by model mod changesZeyla Hellyer2018-01-314-7/+7
| | | | | Fix broken links caused by the `model` module changes in v0.5.0, which split up the module into sub-modules for better organization.
* Reduce number of clones in the libraryZeyla Hellyer2018-01-271-16/+18
|
* Correctly set role's position on new rolesZeyla Hellyer2018-01-271-1/+7
| | | | | | When creating a new role, correctly set its position if a position was specified. This is because the "Create Role" endpoint no longer accepts a `position` key.
* Add functions to reorder a guild's channelsZeyla Hellyer2018-01-272-0/+28
| | | | | Add `http::edit_guild_channel_positions`, `Guild::reorder_channels`, and `GuildId::reorder_channels`.
* Check message ID count in `delete_messages`Zeyla Hellyer2018-01-274-13/+29
| | | | | | In models' `delete_messages` methods, check the number of messages being deleted. If 0 or more than 100, return a `ModelError::BulkDeleteAmount`, as this amount would result in an invalid request.
* Add `Message::member`Zeyla Hellyer2018-01-271-0/+13
| | | | | | | | | Add a `member` function on `model::channel::Message` to retrieve a clone of the author's Member instance in the channel's guild. If the message was not sent in a guild, the guild could not be found in the cache, or the member instance could not be found in the cache, then `None` is returned.
* Account for guild owners in member hierarchy checkZeyla Hellyer2018-01-271-0/+15
| | | | | | When using `Guild::greater_member_hierarchy`, check if both user IDs are the same (returning None) or if one of them is the guild owner, in which case the guild owner's ID is returned.
* Fix compilation for some feature combinationsZeyla Hellyer2018-01-203-1/+7
|
* Fix no-cache compilationacdenisSK2018-01-201-0/+1
|
* Add an `EditMessage` builderZeyla Hellyer2018-01-186-36/+32
| | | | | | When editing messages, not all fields are applicable. Attachments, TTS, and reactions are not applicable. To help with this distinction, separate message editing into a different builder.
* Create unset member instances on presence updatesZeyla Hellyer2018-01-171-0/+19
| | | | | | | | If a presence update for a guild comes in and their associated member instance is not present (e.g. in a large guild that wasn't member chunked), then create one with the infomation known out of the presence update. This includes their user information, guild ID, nickname, and roles, but not their `deaf`, `joined_at`, and `mute` state.
* Fix no-model compiler warningsZeyla Hellyer2018-01-103-3/+3
|
* Fix docs for User::has_roleNikita Pekin2018-01-101-3/+4
| | | | | | | | Update the docs for `User::has_role` to reflect that `Into<GuildContainer>` is only implemented for `PartialGuild`, `GuildId`, and `u64`, not `Guild`. (cherry picked from commit 00deef894ec458ac8abff914ed864ea63c47eda6)
* Allow channels to be moved in and out of a category (#248)Kyle Clemens2018-01-083-8/+12
|
* Fix compilationZeyla Hellyer2018-01-062-6/+5
|