aboutsummaryrefslogtreecommitdiff
path: root/src/model
Commit message (Collapse)AuthorAgeFilesLines
...
* | Document that Reaction methods that hit the APIZeyla Hellyer2017-11-181-2/+8
| | | | | | | | | | | | | | Documents that the following `model::Reaction` methods hit the REST API: - `message` - `users`
* | Add a method to get a message from a reaction (#220)Maiddog2017-11-191-0/+10
| |
* | Add the new game types (#219)Mei Boudreau2017-11-161-0/+62
| |
* | Fix doc-testsacdenisSK2017-11-161-2/+1
| |
* | Implement From<EmojiId | EmojiIdentifier> for ReactionType (#217)Fenhl2017-11-131-0/+18
| |
* | Change PrivateChannel::say to use `Display` (#214)Fenhl2017-11-121-1/+1
| |
* | Re-order use statements alphabeticallyZeyla Hellyer2017-11-1120-72/+62
| |
* | Add Debug derives to more public typesthelearnerofcode2017-11-071-0/+2
| |
* | Actually, change `NeverFails` to a void enumacdenisSK2017-11-051-1/+1
| |
* | Whoops. Add a `FromStr` impl for `ReactionType`acdenisSK2017-11-044-8/+34
| |
* | Merge v0.4.3acdenisSK2017-11-046-53/+101
|\|
| * Fix doctests for a variety of feature targetsZeyla Hellyer2017-11-011-4/+4
| |
| * Fix no-client cache testsZeyla Hellyer2017-11-011-6/+6
| | | | | | | | | | There were a few doctests in the cache module that relied on the client module, so instead feature-gate the doctests.
| * Use consistent token names in examplesZeyla Hellyer2017-11-011-1/+1
| | | | | | | | | | The names of environment variable tokens in the examples differed, so this makes them all use the same name.
| * Make Member::permissions return guild permissionsZeyla Hellyer2017-10-311-11/+3
| | | | | | | | | | | | Fixes what is realistically a bug where `Member::permissions` would retrieve the permissions for the Member in the default channel of the guild. This now only returns the guild-level permissions of the member.
| * Rename `Guild::permissions_for`->`permissions_in`Zeyla Hellyer2017-10-304-7/+18
| | | | | | | | | | | | Rename `Guild::permissions_for` to `Guild::permissions_in`, deprecating `Guild::permissions_for` which is only an inline method to `permissions_in`.
| * Guild::has_perms: use Guild::member_permissionsZeyla Hellyer2017-10-301-22/+14
| | | | | | | | | | | | Make `Guild`'s internal method `has_perms` go through `Guild::member_permissions` to check permissions, since all method that use it don't need channel-specific permissions.
| * Add Guild::member_permissionsZeyla Hellyer2017-10-301-0/+51
| | | | | | | | | | | | Add a method on the Guild for calculating only a member's guild-only permissions, not including the permissions for either the default channel or any specific channel.
| * Add some docs to `BanOptions`acdenisSK2017-10-301-0/+1
| |
| * Fall back to `str::parse` if `parse_username` failsacdenisSK2017-10-241-3/+4
| |
* | `deserialize_i32` -> `deserialize_u8`acdenisSK2017-11-031-1/+1
| |
* | Make the Client return a ResultZeyla Hellyer2017-11-037-9/+20
| | | | | | | | | | | | | | | | The client now returns a Result in preparation of a future commit. Upgrade path: Handle the case of an error via pattern matching, or unwrap the Result.
* | Fix audit logs a bitacdenisSK2017-11-013-39/+82
| |
* | Add a fallback to `RoleId::from_str` as wellacdenisSK2017-10-241-7/+8
| |
* | Remove unwrapsacdenisSK2017-10-241-1/+1
| |
* | Merge v0.4.2acdenisSK2017-10-248-11/+90
|\ \
| * | Fall back to `str::parse` if `parse_username` failsacdenisSK2017-10-241-3/+4
| |/
| * Fix User::has_roleZeyla Hellyer2017-10-241-1/+5
| | | | | | | | | | | | | | | | | | Fix the return value of the function by properly checking whether the user has the role in the given guild. The function made the erraneous mistake of simply checking if the given guild had the role by Id, not whether the _member in the given guild_ had the role by Id.
| * Properly update emojis, fix shard retries, fix csLakelezz2017-10-231-1/+3
| | | | | | | | | | | | | | * If a guild's emojis are being altered, Serenity will straight up use the new `HashMap` instead of just extending. If `connect()` returns an `Err`, it will retry connecting. Cleaned up `help_command.rs`.
| * Deprecate some text-only Channel methodsZeyla Hellyer2017-10-191-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some methods on `model::Channel` are only for text channels. Methods on Channel should be applicable to all channel types. Deprecates the following methods on `model::Channel`: - `create_reaction` - `delete_message` - `delete_reaction` - `edit_message` - `message` - `messages` - `reaction_users` - `say` - `send_files` - `send_message` - `unpin`
| * Implement changing a role's position (#201)Ken Swenson2017-10-192-0/+41
| |
| * Use the underlaying integer value of a `ChannelType` variantacdenisSK2017-10-171-1/+1
| |
| * defer to `delete_message` if there's just one message to deleteacdenisSK2017-10-162-4/+8
| |
| * Hash and do equality on just the id for `User`acdenisSK2017-10-151-1/+17
| |
* | Remove `on_` prefix to EventHandler tymethodsZeyla Hellyer2017-10-226-10/+10
| | | | | | | | | | It was voted that the `on_` prefix is unnecessary, so these have been dropped.
* | Change CreateEmbed::field{,s} to not take buildersZeyla Hellyer2017-10-181-4/+19
| | | | | | | | | | | | | | | | | | Change the `field` and `fields` methods on `builder::CreateEmbed` to not accept a `CreateEmbedField` builder. The embed field builder realistically only had (and most likely, only will) have one optional argument, so the parameters may as well be on `CreateEmbed::field`.
* | Slightly improve performance of buildersZeyla Hellyer2017-10-1810-62/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Builders would keep a `serde_json::Map<String, Value>`, which would require re-creating owned strings for the same parameter multiple times in some cases, depending on builder defaults and keying strategies. This commit uses a `std::collections::HashMap<&'static str, Value>` internally, and moves over values to a `serde_json::Map<String, Value>` when it comes time to sending them to the appropriate `http` module function. This saves the number of heap-allocated string creations on most builders, with specific performance increase on `builder::CreateMessage` and `builder::CreateEmbed` & co.
* | Fix some compilation feature targets, fix lintsZeyla Hellyer2017-10-172-1/+6
| |
* | Change `features` fields to be a Vec<String>Zeyla Hellyer2017-10-143-30/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Discord adds new features, the Feature enum will not be able to serialize the new values until updated, causing the entire Guild deserialization to fail. Due to the fact that these features can be added at any time, the `features` vector on Guild and PartialGuild have been changed to be a `Vec<String>`. Upgrade path: Instead of matching on variants of Feature like so: ```rust use serenity::model::Feature; for feature in guild.features { if feature == Feature::VipRegions { // do work with this info } } ``` Instead opt to check the string name of the feature: ```rust for feature in guild.features { if feature == "VIP_REGIONS" { // do work with this info } } ```
* | Update to account for changes made in 0.4.1acdenisSK2017-10-145-62/+251
|\|
| * Add try_opt macro for substituteMei Boudreau2017-10-121-4/+1
| |
| * Optimize Member::rolesMei Boudreau2017-10-121-21/+11
| |
| * Fix clippy lintsZeyla Hellyer2017-10-114-48/+48
| |
| * Variety of methods to search for `Member`. (#187)Lakelezz2017-10-101-12/+218
| |
| * Generate `Default` for CurrentUser and use it in `Cache::default`acdenisSK2017-10-082-2/+2
| |
| * Add an impl for `&str`acdenisSK2017-10-081-0/+4
| |
| * Find `Member` via substrings, allow case-insensitivity on ↵Lakelezz2017-10-071-4/+54
| | | | | | | | `members_containing` and `members_starting_with` (#184)
| * Help-commands filtering and Member-prefix-search (#182)Lakelezz2017-10-071-0/+18
| |
| * Fix a typoacdenisSK2017-10-051-1/+1
| |
| * Add an andacdenisSK2017-10-051-1/+1
| |