aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* Change default branch to 'current'Zeyla Hellyer2018-09-131-2/+2
| | | | | | | | | The default branch of 'master' has a few issues, but the biggest technical issue is that it doesn't accurately represent the development work done on it by name alone: is it the branch for maintaining the "current" released version, or for the development of the next majour version? In certain Rust projects these are combined into one branch, but we don't do this, so this is one way out of the ambiguity.
* Fix all the dead links in the docsErk-2018-08-091-1/+1
|
* Fix a usage of a private function in a testZeyla Hellyer2018-08-071-1/+1
|
* Fix compilation + tests on certain feature combosZeyla Hellyer2018-08-071-2/+15
| | | | | | | | On certain feature combinations, compilation and tests would not function correctly. This commit goes through a number of feature combinations and gates some tests behind the required features and fixes other compilation errors.
* Move unit tests into sourceZeyla Hellyer2018-08-011-0/+4
| | | | | | | | | Move the unit tests into the relevant source files. There's no need for them to be seprate, especially when the `tests` directory is meant to be for integration tests. The deserialization tests that include JSON files are still in the `tests` dir, along with the public prelude re-export tests.
* Add a message cache API (#345)zeyla2018-07-091-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds an API for message caching. By default this caches 0 messages per channel. This can be customized when instantiating: ```rust use serenity::cache::{Cache, Settings}; let mut settings = Settings::new(); // Cache 10 messages per channel. settings.max_messages(10); let cache = Cache::new_with_settings(settings); ``` After instantiation: ```rust use serenity::cache::Cache; let mut cache = Cache::new(); cache.settings_mut().max_messages(10); ``` And during runtime through the global cache: ```rust use serenity::CACHE; CACHE.write().settings_mut().max_messages(10); ```
* Fix links to the repoZeyla Hellyer2018-05-231-2/+2
| | | | | Fixes links to the repo from `https://github.com/zeyla/serenity` to `https://github.com/serenity-rs/serenity`.
* Bump to v0.5.0v0.5.0Zeyla Hellyer2018-01-201-1/+1
|
* Update readme exampleZeyla Hellyer2018-01-181-4/+7
|
* Revamp the internals of `Args`acdenisSK2017-12-161-2/+0
| | | | Fixes #180, however this partially breaks `single_zc` and `multiple_quoted`, but since they're minor it's better to fix them later for now.
* Merge v0.4.3acdenisSK2017-11-041-1/+6
|\
| * Fix ping bot example (#211)Ben2017-10-311-1/+6
| |
* | Fix some compilation feature targets, fix lintsZeyla Hellyer2017-10-171-2/+1
| |
* | Update to account for changes made in 0.4.1acdenisSK2017-10-141-13/+11
|\|
| * Feature-flag extern crates behind their nameZeyla Hellyer2017-10-141-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An issue with modifying what features enable compilation of what crates was possible due to crates being feature-flagged behind a module name instead of their own name. Instead of writing cfg features for crates as: ```rust \#[cfg(feature = "utils")] extern crate base64; ``` Write the feature name as its own name: ```rust \#[cfg(feature = "base64")] extern crate base64; ``` This way, crates can simply have compilation enabled in the project's features section in the `Cargo.toml` file.
| * Fix clippy lintsZeyla Hellyer2017-10-111-3/+0
| |
| * Add a threadpool to the shard runnerZeyla Hellyer2017-10-091-0/+2
| | | | | | | | | | | | 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.
* | Switch to parking_lot::{Mutex, RwLock}Zeyla Hellyer2017-10-101-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 a threadpool to the shard runnerZeyla Hellyer2017-10-091-0/+2
|/ | | | | | 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.
* Update readme exampleZeyla Hellyer2017-09-251-1/+2
|
* Bump to v0.4.0Zeyla Hellyer2017-09-251-1/+1
|
* Switch to temporary rust-websocket forkZeyla Hellyer2017-09-251-1/+1
|
* Remove tokio usageZeyla Hellyer2017-09-211-4/+0
|
* Fix compiles of a variety of feature combinationsZeyla Hellyer2017-09-181-4/+10
| | | | | This fixes compilation errors and warnings when compiling a mixture of non-default feature targets.
* Revamp `CacheEventsImpl`acdenisSK2017-09-121-2/+0
|
* Revamp `RwLock` usage in the libacdenisSK2017-08-241-3/+3
| | | | Also not quite sure if they goofed rustfmt or something, but its changes it did were a bit bizarre.
* Allow FromStr for User to use REST (#147)Maiddog2017-08-241-1/+2
|
* Fix tests (#145)Maiddog2017-08-221-1/+1
|
* feature-flag the vec_shift dependencyacdenisSK2017-08-211-1/+2
|
* Revamp the args to an `Args` structacdenisSK2017-08-201-4/+1
| | | | Fixes #142
* Use wildcardacdenisSK2017-08-191-1/+1
|
* Move builtin framework impl to its own moduleZeyla Hellyer2017-08-191-1/+1
| | | | | | | | | | | | | | | | | 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.
* Add html_root_urlacdenisSK2017-08-191-0/+1
|
* Move Clippy lints to a cfg_attrZeyla Hellyer2017-08-181-1/+1
|
* Move the Framework trait to the frameworkZeyla Hellyer2017-08-181-21/+0
|
* ClippyacdenisSK2017-08-191-1/+1
|
* Fix string delimiters (#134)Lakelezz2017-08-131-0/+4
|
* Split event handling in the cache to a traitacdenisSK2017-08-101-0/+2
| | | | note: This trait might become like `framework::Framework` in the future.
* Remove the `ext` module and remove a matchacdenisSK2017-08-011-2/+0
| | | | | The `ext` has existed for a long while just for backwards compatibility. But then again, majority of people should have migrated to the current modules already; making this module useless to keep in the library.
* rustfmtacdenisSK2017-07-271-33/+35
|
* Make the `framework` module feature-gated and fix the names in the helper macroacdenisSK2017-07-271-2/+21
|
* Switch to tokio for events (#122)Alex Lyon2017-07-141-0/+5
|
* Fixed clippy warnings (#118)Kaidan2017-06-281-2/+0
|
* Bump to v0.3.0v0.3.0Zeyla Hellyer2017-06-241-1/+1
|
* Fix no-framework compilationZeyla Hellyer2017-06-141-0/+2
|
* Upgrade rust-websocket, rust-openssl, and hyperZeyla Hellyer2017-06-071-0/+4
| | | | | | | | | | | | | | | | Upgrade `rust-websocket` to v0.20, maintaining use of its sync client. This indirectly switches from `rust-openssl` v0.7 - which required openssl-1.0 on all platforms - to `native-tls`, which allows for use of schannel on Windows, Secure Transport on OSX, and openssl-1.1 on other platforms. Additionally, since hyper is no longer even a dependency of rust-websocket, we can safely and easily upgrade to `hyper` v0.10 and `multipart` v0.12. This commit is fairly experimental as it has not been tested on a long-running bot.
* Deprecate Client::login, add Client::newZeyla Hellyer2017-06-061-3/+3
|
* Clippy lintsZeyla Hellyer2017-06-061-2/+0
|
* Use chrono for struct timestamp fieldsZeyla Hellyer2017-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix compilations across feature combinationsZeyla Hellyer2017-06-021-0/+2
|