aboutsummaryrefslogtreecommitdiff
path: root/src/model/channel
Commit message (Collapse)AuthorAgeFilesLines
...
| * 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`
| * defer to `delete_message` if there's just one message to deleteacdenisSK2017-10-162-4/+8
| |
* | Remove `on_` prefix to EventHandler tymethodsZeyla Hellyer2017-10-222-4/+4
| | | | | | | | | | 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-185-35/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Update to account for changes made in 0.4.1acdenisSK2017-10-141-2/+2
|\|
| * Fix clippy lintsZeyla Hellyer2017-10-111-2/+2
| |
| * Fix a typoacdenisSK2017-10-051-1/+1
| |
| * Use an as_ref hackacdenisSK2017-10-052-3/+3
| |
| * Replace slice parametres by IntoIterator (#177)François Triquet2017-10-054-4/+4
| | | | | | Fixes #174
| * Fix most clippy warningsMaiddog2017-10-041-1/+1
| |
| * Replace Vec parameters by IntoIterator (#176)François Triquet2017-10-045-5/+5
| |
| * Revert "Use the de-generification trick."acdenisSK2017-10-034-72/+15
| | | | | | | | Makes the compiliation time just a bit worse
| * Use the de-generification trick.acdenisSK2017-10-024-15/+72
| | | | | | | | Fixes #168
| * `to_owned` -> `to_string`acdenisSK2017-10-014-10/+10
| |
* | Switch to parking_lot::{Mutex, RwLock}Zeyla Hellyer2017-10-106-41/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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); ```
* | Fix a typoacdenisSK2017-10-091-1/+1
| |
* | Use an as_ref hackacdenisSK2017-10-092-3/+3
| |
* | Replace slice parametres by IntoIterator (#177)François Triquet2017-10-094-4/+4
| | | | | | Fixes #174
* | Fix most clippy warningsMaiddog2017-10-091-1/+1
| |
* | Replace Vec parameters by IntoIterator (#176)François Triquet2017-10-095-5/+5
| |
* | Revert "Use the de-generification trick."acdenisSK2017-10-094-72/+15
| | | | | | | | Makes the compiliation time just a bit worse
* | Use the de-generification trick.acdenisSK2017-10-094-15/+72
| | | | | | | | Fixes #168
* | `to_owned` -> `to_string`acdenisSK2017-10-094-10/+10
|/
* Use `request_client!` for attachment downloading (#165)Benjamin Cheng2017-09-261-1/+1
|
* Refactor display impls for idsacdenisSK2017-09-241-5/+0
|
* Update bitflags, other dependenciesZeyla Hellyer2017-09-214-21/+21
| | | | | | | | | | | | | | | | | | | | | | | 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-189-96/+50
|
* Fix compiles of a variety of feature combinationsZeyla Hellyer2017-09-188-28/+50
| | | | | This fixes compilation errors and warnings when compiling a mixture of non-default feature targets.
* Apply rustfmtZeyla Hellyer2017-09-181-1/+3
|
* Gate ChannelCategory impl behind 'model' featureZeyla Hellyer2017-09-181-0/+1
| | | | | The rest of the models in the model module have their implementations gated behind the "model" feature, so do the same here.
* if let -> and_then/mapacdenisSK2017-09-171-5/+1
|
* serde rename `kind` to `type`acdenisSK2017-09-091-0/+1
|
* Apply rustfmt + fix testsZeyla Hellyer2017-09-093-6/+24
|
* `parent_id` -> `category_id`acdenisSK2017-09-092-4/+6
|
* Implement categoriesacdenisSK2017-09-094-0/+149
|
* Prevent malformed opus data from crashing the bot process (#149)Maiddog2017-08-271-25/+28
|
* Add ability to play DCA and Opus files. (#148)Maiddog2017-08-276-50/+90
|
* Revamp `RwLock` usage in the libacdenisSK2017-08-247-130/+92
| | | | Also not quite sure if they goofed rustfmt or something, but its changes it did were a bit bizarre.
* Fix tests (#145)Maiddog2017-08-221-0/+1
|
* Have the variants be renamed to use snake_caseacdenisSK2017-08-221-1/+1
|
* Move builtin framework impl to its own moduleZeyla Hellyer2017-08-191-2/+2
| | | | | | | | | | | | | | | | | The framework is now moved in its entirity to the `framework` module, with the `Framework` trait currently on its own and the builtin implementation provided. The builtin implementation has been renamed to "Standard". Upgrade path: Rename the `BuiltinFramework` import to `StandardFramework`. Instead of importing builtin framework items from `serenity::framework`, import them from `serenity::framework::standard`. This is the beginning to #60. The root `framework` module (non-standard implementation) will be built more by the time it's closed.
* Revert back to `deserialize_map`acdenisSK2017-08-191-3/+1
|
* `name` in reactions can be nullableacdenisSK2017-08-191-30/+8
|
* Apply rustfmtZeyla Hellyer2017-08-187-40/+78
|
* Use `#[serde(default)]` on `nsfw` insteadacdenisSK2017-08-151-3/+1
|
* Make some functions accept anything that's implemented DisplayacdenisSK2017-08-041-1/+1
|
* Change the config a bit, and a few nitpicksacdenisSK2017-07-278-174/+115
|
* rustfmtacdenisSK2017-07-279-381/+413
|
* Fix is_own codeZeyla Hellyer2017-07-251-1/+1
| | | | | The current user ID is located on the `user` structfield in the cache, and is not directly on the cache.