aboutsummaryrefslogtreecommitdiff
path: root/src/builder/create_embed.rs
Commit message (Collapse)AuthorAgeFilesLines
* Fix doc-testsacdenisSK2017-11-081-2/+2
|
* Into<String> -> DisplayacdenisSK2017-11-071-6/+6
|
* Whoops. Add a `FromStr` impl for `ReactionType`acdenisSK2017-11-041-6/+0
|
* Merge v0.4.3acdenisSK2017-11-041-0/+6
|\
| * Fix no-client cache testsZeyla Hellyer2017-11-011-1/+1
| | | | | | | | | | There were a few doctests in the cache module that relied on the client module, so instead feature-gate the doctests.
* | Make the Client return a ResultZeyla Hellyer2017-11-031-2/+8
| | | | | | | | | | | | | | | | 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.
* | Remove `on_` prefix to EventHandler tymethodsZeyla Hellyer2017-10-221-2/+2
| | | | | | | | | | 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-84/+22
| | | | | | | | | | | | | | | | | | 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-181-45/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
|\|
| * Fix clippy lintsZeyla Hellyer2017-10-111-1/+1
| |
| * Replace Vec parameters by IntoIterator (#176)François Triquet2017-10-041-1/+1
| |
| * Revert "Use the de-generification trick."acdenisSK2017-10-031-13/+3
| | | | | | | | Makes the compiliation time just a bit worse
| * Use the de-generification trick.acdenisSK2017-10-021-3/+13
| | | | | | | | Fixes #168
| * `to_owned` -> `to_string`acdenisSK2017-10-011-27/+27
| |
* | Switch to parking_lot::{Mutex, RwLock}Zeyla Hellyer2017-10-101-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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); ```
* | Replace Vec parameters by IntoIterator (#176)François Triquet2017-10-091-1/+1
| |
* | Revert "Use the de-generification trick."acdenisSK2017-10-091-13/+3
| | | | | | | | Makes the compiliation time just a bit worse
* | Use the de-generification trick.acdenisSK2017-10-091-3/+13
| | | | | | | | Fixes #168
* | `to_owned` -> `to_string`acdenisSK2017-10-091-27/+27
|/
* Apply rustfmtZeyla Hellyer2017-09-181-48/+23
|
* Add ability to play DCA and Opus files. (#148)Maiddog2017-08-271-23/+48
|
* Revamp `RwLock` usage in the libacdenisSK2017-08-241-48/+23
| | | | Also not quite sure if they goofed rustfmt or something, but its changes it did were a bit bizarre.
* Apply rustfmtZeyla Hellyer2017-08-181-23/+48
|
* Fix the test `message_content_safe`acdenisSK2017-08-061-1/+1
| | | | This commit does NOT interfere with the "accept Display" change to the builder
* Refactor the display stuff a bitacdenisSK2017-08-041-18/+5
|
* Make some functions accept anything that's implemented DisplayacdenisSK2017-08-041-11/+24
|
* Change the config a bit, and a few nitpicksacdenisSK2017-07-271-13/+15
|
* rustfmtacdenisSK2017-07-271-42/+55
|
* Add a way to add multiple fields at onceacdenisSK2017-07-111-0/+20
|
* Fix doc testsacdenisSK2017-07-021-37/+44
|
* Add support for sending attachments in embeds (#95)alex2017-06-281-0/+10
|
* Deprecate Client::login, add Client::newZeyla Hellyer2017-06-061-2/+2
|
* Use chrono for struct timestamp fieldsZeyla Hellyer2017-06-061-15/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chrono is easier to use than timestamped strings, so they should be automatically deserialized and available for the user, instead of having the user deserialize the strings themselves. These fields have been changed to use a type of `DateTime<FixedOffset>`: - `ChannelPinsUpdateEvent.last_pin_timestamp` - `Group.last_pin_timestamp` - `Guild.joined_at` - `GuildChannel.last_pin_timestamp` - `Invite.created_at` - `Member.joined_at` - `Message.edited_timestamp - `Message.timestamp` - `MessageUpdateEvent.edited_timestamp` - `MessageUpdateEvent.timestamp` - `PrivateChannel.last_pin_timestamp` `Member.joined_at` is now also an `Option`. Previously, if a Guild Member Update was received for a member not in the cache, a new Member would be instantiated with a default String value. This is incorrect behaviour, and has now been replaced with being set to `None` in that case. Id methods' `created_at()` method now return a `chrono::NaiveDateTime` instead of a `time::Timespec`, and `User::created_at` has been updated to reflect that. Additionally, drop `time` as a direct dependency and use chrono for internals.
* Add some model docs, deprecate Role::edit_roleMaiddog2017-06-031-5/+5
| | | Deprecate `Role::edit_role` and rename it to `Role::edit`.
* Restructure modulesZeyla Hellyer2017-05-221-0/+415
Modules are now separated into a fashion where the library can be used for most use cases, without needing to compile the rest. The core of serenity, with no features enabled, contains only the struct (model) definitions, constants, and prelude. Models do not have most functions compiled in, as that is separated into the `model` feature. The `client` module has been split into 3 modules: `client`, `gateway`, and `http`. `http` contains functions to interact with the REST API. `gateway` contains the Shard to interact with the gateway, requiring `http` for retrieving the gateway URL. `client` requires both of the other features and acts as an abstracted interface over both the gateway and REST APIs, handling the event loop. The `builder` module has been separated from `utils`, and can now be optionally compiled in. It and the `http` feature are required by the `model` feature due to a large number of methods requiring access to them. `utils` now contains a number of utilities, such as the Colour struct, the `MessageBuilder`, and mention parsing functions. Each of the original `ext` modules are still featured, with `cache` not requiring any feature to be enabled, `framework` requiring the `client`, `model`, and `utils`, and `voice` requiring `gateway`. In total the features and their requirements are: - `builder`: none - `cache`: none - `client`: `gateway`, `http` - `framework`: `client`, `model`, `utils` - `gateway`: `http` - `http`: none - `model`: `builder`, `http` - `utils`: none - `voice`: `gateway` The default features are `builder`, `cache`, `client`, `framework`, `gateway`, `model`, `http`, and `utils`. To help with forwards compatibility, modules have been re-exported from their original locations.