aboutsummaryrefslogtreecommitdiff
path: root/src/model/guild
Commit message (Collapse)AuthorAgeFilesLines
...
* Whoops. Add a `FromStr` impl for `ReactionType`acdenisSK2017-11-042-7/+7
|
* Merge v0.4.3acdenisSK2017-11-042-41/+86
|\
| * 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-302-5/+16
| | | | | | | | | | | | 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
| |
* | `deserialize_i32` -> `deserialize_u8`acdenisSK2017-11-031-1/+1
| |
* | Make the Client return a ResultZeyla Hellyer2017-11-032-2/+2
| | | | | | | | | | | | | | | | 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
| |
* | Merge v0.4.2acdenisSK2017-10-242-1/+42
|\|
| * 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
| |
* | Remove `on_` prefix to EventHandler tymethodsZeyla Hellyer2017-10-222-2/+2
| | | | | | | | | | It was voted that the `on_` prefix is unnecessary, so these have been dropped.
* | Slightly improve performance of buildersZeyla Hellyer2017-10-182-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-142-42/+231
|\|
| * Add try_opt macro for substituteMei Boudreau2017-10-121-4/+1
| |
| * Optimize Member::rolesMei Boudreau2017-10-121-21/+11
| |
| * Fix clippy lintsZeyla Hellyer2017-10-111-28/+28
| |
| * Variety of methods to search for `Member`. (#187)Lakelezz2017-10-101-12/+218
| |
| * 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
| |
| * Revert "Use the de-generification trick."acdenisSK2017-10-033-108/+35
| | | | | | | | Makes the compiliation time just a bit worse
| * Use the de-generification trick.acdenisSK2017-10-023-35/+108
| | | | | | | | Fixes #168
| * `to_owned` -> `to_string`acdenisSK2017-10-012-3/+3
| |
* | Switch to parking_lot::{Mutex, RwLock}Zeyla Hellyer2017-10-105-50/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch to the `parking_lot` crate's implementations of `std::sync::Mutex` and `std::sync::RwLock`, which are more efficient. A writeup on why `parking_lot` is more efficient can be read here: <https://github.com/Amanieu/parking_lot> Upgrade path: Modify `mutex.lock().unwrap()` usage to `mutex.lock()` (not needing to unwrap or handle a result), and `rwlock.read().unwrap()`/`rwlock.write().unwrap()` usage to `rwlock.read()` and `rwlock.write()`. For example, modify: ```rust use serenity::CACHE; println!("{}", CACHE.read().unwrap().user.id); ``` to: ```rust use serenity::CACHE; println!("{}", CACHE.read().user.id); ```
* | Add an impl for `&str`acdenisSK2017-10-091-0/+4
| |
* | Find `Member` via substrings, allow case-insensitivity on ↵Lakelezz2017-10-091-4/+54
| | | | | | | | `members_containing` and `members_starting_with` (#184)
* | Help-commands filtering and Member-prefix-search (#182)Lakelezz2017-10-091-0/+18
| |
* | Revert "Use the de-generification trick."acdenisSK2017-10-093-108/+35
| | | | | | | | Makes the compiliation time just a bit worse
* | Use the de-generification trick.acdenisSK2017-10-093-35/+108
| | | | | | | | Fixes #168
* | `to_owned` -> `to_string`acdenisSK2017-10-092-3/+3
| |
* | Change behaviour of default_channel (#185)Mei Boudreau2017-10-072-8/+25
| |
* | Change default_channel to return a pointer (#179)Mei Boudreau2017-10-052-6/+8
|/
* Refactor display impls for idsacdenisSK2017-09-243-14/+0
|
* Update bitflags, other dependenciesZeyla Hellyer2017-09-212-23/+32
| | | | | | | | | | | | | | | | | | | | | | | Bitflags changed its macro codegen from creating constants to associated constants on structs. Upgrade path: Update code from: ```rust use serenity::model::permissions::{ADD_REACTIONS, MANAGE_MESSAGES}; foo(vec![ADD_REACTIONS, MANAGE_MESSAGES]); ``` to: ```rust use serenity::model::Permissions; foo(vec![Permissions::ADD_REACTIONS, Permissions::MANAGE_MESSAGES]); ```
* Apply rustfmtZeyla Hellyer2017-09-186-86/+75
|
* Fix compiles of a variety of feature combinationsZeyla Hellyer2017-09-185-11/+12
| | | | | This fixes compilation errors and warnings when compiling a mixture of non-default feature targets.
* Apply rustfmt + fix testsZeyla Hellyer2017-09-092-4/+5
|
* Update `Guild::ban` to use `BanOptions`acdenisSK2017-09-062-9/+11
| | | | Also update `Member::permissions` to the default channel change
* Remove more non-bot user endpointsZeyla Hellyer2017-09-013-50/+0
| | | | | | | | | | | | These include the following functions removed: - `http::get_application_info` - `http::get_applications` - `http::get_emoji` - `http::get_emojis` - `model::Guild::{emoji, emojis}` - `model::GuildId::{emoji, emojis}` - `model::PartialGuild::{emoji, emojis}`
* Make role references attainable via nameLakelezz2017-08-292-0/+69
|
* Add ability to play DCA and Opus files. (#148)Maiddog2017-08-277-73/+90
|
* Revamp `RwLock` usage in the libacdenisSK2017-08-247-97/+80
| | | | Also not quite sure if they goofed rustfmt or something, but its changes it did were a bit bizarre.
* Fix rustfmt lines that are too longZeyla Hellyer2017-08-182-2/+4
| | | | | Apparently rustfmt can't fix some of these, causing it to exit with 3 and therefore failing the build.
* Apply rustfmtZeyla Hellyer2017-08-185-59/+72
|
* ClippyacdenisSK2017-08-192-11/+5
|