aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove global Cache (#448)Lakelezz2018-12-181-41/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | * Update to use Rust 2018. * Update examples and use Rust 2018. * Pass cache via `Context` around instead of being global. * Remove `lazy_static` from `cache`-feature. * Update examples to use `Context`'s cache. * Replace cache's update-timeout-setting with `update_cache_timeout`. * Update documentation to stop using global cache. * Move `HttpAndCache` to `lib.rs`. * Add `__nonexhaustive`-field to `CacheAndHttp`. * Add `__nonexhaustive` in `CacheAndHttp`-initialisers. * Avoid `__nonexhaustive`-usage in doctest. * Remove unnecessary comma in `cfg`-attribute.
* Update to Rust 2018 (#445)Lakelezz2018-12-071-8/+8
|
* Switch to tungstenite from rust-websocket (#341)acdenisSK2018-11-211-2/+4
|
* Replace `hyper` with `reqwest` (#440)Lakelezz2018-11-191-8/+4
|
* Voice fixes, better API adherence, bitrate control, documentationKyle Simpson2018-11-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fixing silence frame. * Messed that one up while fighting with the borrow checker. Sorry! * Initial machinery for playback position tracking * Mix multiple input AudioType::Opus streams * Encode for stereo, use nicer "soft clip" * First stab at docs for Audio. * Better-er docs for voice::Audio etc. * Bitrate control. * Fix #270, Better handling of the voice api We were mostly doing the voice API wrong, I've changed OpCode names to be correct. We now listenfor both Ready and Hello at connection init, and do soft checks for Heartbeat ACKs. * Adding missing voice opcodes, related structs * Also removes events for messages which cannot be received. @Zeyla's recommended changes. * New docstrings now have correct style for referring to functions. * Docstrings also have room to breathe (!) * Rand dependency now properly moved behind the `voice` feature. * Slightly cleaner checks at voice connection initialisation. * Various idiomatic changes throughout. * Prevent compilation of Audio docs example. Likely too much machinery in the background to get a working Handler, I think. * Re-fixing the docstrings. * Fixing travis for Audio docs.
* 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
|