aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | Switch to parking_lot::{Mutex, RwLock}Zeyla Hellyer2017-10-1035-320/+401
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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); ```
* | Resume on resumable session invalidationsZeyla Hellyer2017-10-092-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Session invalidations include whether the session may be resumable. Previously, this was not parsed by serenity. This data is now contained in `GatewayEvent::InvalidateSession` as a boolean, which constitutes a breaking change for users that manually handle gateway events. Upgrade path: Instead of pattern matching on simply the variant like so: ```rust use serenity::model::event::GatewayEvent; match gateway_event { GatewayEvent::InvalidateSession => { // work here }, // other matching arms here _ => {}, } ``` Instead pattern match it as a single field tuple-struct: ```rust use serenity::model::event::GatewayEvent; match gateway_event { GatewayEvent::InvalidateSession(resumable) => { // work here }, // other matching arms here _ => {}, } ```
* | Make webhook_id a majour parameter in ratelimitingZeyla Hellyer2017-10-092-4/+19
| | | | | | | | | | This change is made due to this change in documentation: <https://github.com/discordapp/discord-api-docs/commit/32d06c360867cead6aa785ff10c437fdb2743bd6?short_path=5f625d6#diff-5f625d6c4303e22c3d6af4c8d6df28fe>
* | Reset shard heartbeat state on resumeZeyla Hellyer2017-10-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | When a resume is received, the heartbeat state would not be reset. This state includes: - whether the last heartbeat was acknowledged - when the last heartbeat was sent - when the last heartbeat acknowledgement was received This resulted in the bot re-IDENTIFYing after a Resumed event was received. To fix this issue, reset them when a Resumed event is received.
* | Make the client threadpool user-customizableZeyla Hellyer2017-10-094-15/+38
| | | | | | | | | | | | In addition to making the threadpool used by client shards customizable by the user, make only a single threadpool (as opposed to one per shard) and share it across all shards.
* | Add a threadpool to the shard runnerZeyla Hellyer2017-10-093-27/+56
| | | | | | | | | | | | A threadpool will help with giving event dispatches a threaded behaviour while still allowing the library the ability to perform other actions, such as receiving new events and heartbeating over the websocket client.
* | Generate `Default` for CurrentUser and use it in `Cache::default`acdenisSK2017-10-093-12/+3
| |
* | 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)
* | Add the lifetime againacdenisSK2017-10-091-1/+1
| |
* | Help-commands filtering and Member-prefix-search (#182)Lakelezz2017-10-093-19/+40
| |
* | Make `has_correct_permissions` a free-standing functionacdenisSK2017-10-091-15/+15
| |
* | Fix a typoacdenisSK2017-10-091-1/+1
| |
* | Add an andacdenisSK2017-10-091-1/+1
| |
* | Use an as_ref hackacdenisSK2017-10-096-10/+17
| |
* | Replace slice parametres by IntoIterator (#177)François Triquet2017-10-097-9/+15
| | | | | | Fixes #174
* | Fix most clippy warningsMaiddog2017-10-099-32/+20
| |
* | Replace Vec parameters by IntoIterator (#176)François Triquet2017-10-0911-17/+17
| |
* | Force `I` to be not implemented outside serenityacdenisSK2017-10-091-3/+15
| |
* | Revert "Use the de-generification trick."acdenisSK2017-10-0919-346/+117
| | | | | | | | Makes the compiliation time just a bit worse
* | Use the de-generification trick.acdenisSK2017-10-0919-119/+348
| | | | | | | | Fixes #168
* | `to_owned` -> `to_string`acdenisSK2017-10-0934-176/+176
| |
* | Have `ConnectionStage` derive CopyacdenisSK2017-10-092-6/+6
| | | | | | | | Since it's a fairly simple enum. Also changed `is_connecting` to be more idiomatic.
* | Rename an internal Shard Runner methodZeyla Hellyer2017-10-091-2/+2
| | | | | | | | | | `ShardRunner::recv_events` actually only receives one event, so de-pluralize it.
* | Improve shard logicZeyla Hellyer2017-10-093-113/+168
| | | | | | | | | | | | | | | | | | | | Improve shard logic by more cleanly differentiating when resuming, as well as actually fixing resume logic. For shard runners, better handling of dead clients is added, as well as more use of the shard manager, in that the runner will now more liberally request a restart when required (instead of sitting and doing nothing infinitely).
* | Improve shard and shard runner loggingZeyla Hellyer2017-10-092-60/+99
| |
* | WhoopsacdenisSK2017-10-091-2/+2
| |
* | Add a todoacdenisSK2017-10-091-0/+1
| |
* | Make the internal string publicacdenisSK2017-10-091-1/+1
| |
* | Change behaviour of default_channel (#185)Mei Boudreau2017-10-072-8/+25
| |
* | Do not to " " if none of the provided delimiters are found (#183)Jacob Helwig2017-10-072-9/+8
| |
* | Change default_channel to return a pointer (#179)Mei Boudreau2017-10-052-6/+8
| |
* | Merge branch 'v0.4.1' into v0.5.0acdenisSK2017-09-302-9/+23
|\|
| * Fix a few things with the framework traitacdenisSK2017-09-302-9/+23
| |
* | Change the way users' command handlers are stored asacdenisSK2017-09-294-33/+23
|/
* Fix User::tag and CurrentUser::tag discrim outputZeyla Hellyer2017-09-281-1/+1
| | | | | The output in a tag may result in "username#304" instead of the correct "username#0304".
* Fix client shards by cloning ShardManager runnersZeyla Hellyer2017-09-274-10/+15
| | | | | | Due to the new ShardManager, `Client::shards` would never fill, so instead clone the `shard_runners` instance from the `ShardManager` to the `Client`.
* Fix client no-framework compilationZeyla Hellyer2017-09-274-32/+79
|
* Use `request_client!` for attachment downloading (#165)Benjamin Cheng2017-09-261-1/+1
|
* Update readme exampleZeyla Hellyer2017-09-251-1/+2
|
* Bump to v0.4.0Zeyla Hellyer2017-09-251-1/+1
|
* Use display instead of std::error::ErroracdenisSK2017-09-251-28/+3
| | | | Kind of a bad decision but due to the compiler being a meany with impl conflicts for `From<&str>` and `From<String>`, it needs to be done. Plus it removes the useless custom struct.
* Switch to temporary rust-websocket forkZeyla Hellyer2017-09-251-1/+1
|
* Fix tests and example 05Zeyla Hellyer2017-09-244-12/+14
|
* Add a shard managerZeyla Hellyer2017-09-248-286/+547
| | | | The shard manager will queue up shards for booting.
* Use $crate for CommandErroracdenisSK2017-09-241-3/+3
|
* Refactor display impls for idsacdenisSK2017-09-246-24/+7
|
* Revamp errors in `Args` and commandsacdenisSK2017-09-236-86/+141
|
* Document http::set_token and unhide it from docsZeyla Hellyer2017-09-231-3/+22
|
* Update bitflags, other dependenciesZeyla Hellyer2017-09-219-78/+87
| | | | | | | | | | | | | | | | | | | | | | | 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]); ```