| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
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 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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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);
```
|
| |
|
|
|
| |
Fixes links to the repo from `https://github.com/zeyla/serenity` to
`https://github.com/serenity-rs/serenity`.
|
| | |
|
| | |
|
| |
|
|
| |
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.
|
| |\ |
|
| | | |
|
| | | |
|
| |\| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
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 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);
```
|
| |/
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This fixes compilation errors and warnings when compiling a mixture of
non-default feature targets.
|
| | |
|
| |
|
|
| |
Also not quite sure if they goofed rustfmt or something, but its changes it did were a bit bizarre.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Fixes #142
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
note: This trait might become like `framework::Framework` in the future.
|
| |
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|