| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
If a user account changes their profile settings, they'll receive a new
token; update the locally stored token for REST requests with this
token.
Additionally, the `Context::edit_profile` does not need mutability over
self.
Fixes #25.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Paginate the rest::get_guilds endpoint, which can be used to retrieve
the guilds after-or-before a certain guild's Id, with a limit of results
to return (100 is the max).
Example usage:
```rs
use serenity::client::rest::GuildPagination;
let target = GuildPagination::After(GuildId(81384788765712384));
let guilds = context.get_guilds(target, 50);
```
Additionally, add a method of `CurrentUser::guilds()`, to retrieve the
current user's guilds. A limit of 100 is set, as (most) users can not be
in more than 100 guilds.
|
| |
|
|
|
|
| |
Commands should be dispatched more quickly with this patch. This brings
down a (locally-tested) average "ping" command response from 278ms to
67ms.
|
| |
|
|
|
| |
The @ everyone role can have a position of -1 _or_ 0, so make it an
i64.
|
| |
|
|
|
|
|
| |
Searches the Cache for the Id of the guild that the message was posted
to - if any - and if the guild and channel data are cached.
Requires the `cache` and `method` feature flags be enabled.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This will allow the command macro to be used in sub-modules.
|
| | |
|
| | |
|
| |
|
|
| |
Add a Blurple colour with RGB value 114,137,218.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
The status routes were missing from the HTTP module (now the REST
module) rewrite, as well as the `GET /guilds/:id/members` route. In
addition, remove an unnecessary counter to the global ratelimit mutex.
|
| |
|
|
|
|
|
|
| |
The examples include a README located in `examples/README.md`, which
contains instructions for running these examples.
They act as a simple form of tutorial to the library, without getting
into too many details.
|
| | |
|
| |
|
|
| |
✨
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Audio can be played with support by passing one of the following into
the `Handler::play` method:
`serenity::ext::voice::{ffmpeg, pcm, ytdl}` functions, where
- `ffmpeg` accepts a path (such as a `File`);
- `pcm` accepts a raw reader source;
- `ytdl` accepts a URI, which works with everything youtube-dl supports:
<https://github.com/rg3/youtube-dl/blob/master/docs/supportedsites.md>
The source can be stopped via [`Handler::stop`].
Receive is supported through [`Handler::listen`], which accepts a
`serenity::ext::voice::AudioReceiver` implementation.
An example is provided in the form of the file located at
`./examples/07_voice.rs`, which can be run by cloning the repo and
performing the command `cargo run --example 07_voice`. Prior to running
the command, set a bot token as the value of the env variable
`DISCORD_TOKEN`. The example supports:
- `deafen`: deafens the bot;
- `join`: joins a voice channel by ID. The example is a primitive
implementation, and requires the ID of the channel to be passed to the
bot as a command of `~join 131937933270712320`;
- `leave`: leaves the current voice channel, if in one;
- `mute`: mutes the bot and will continue to play source audio;
- `play`: plays source audio from a URI, through a command like
`~play https://www.youtube.com/watch?v=5KJjBRm0ElA`;
- `ping`: responds with "Pong!" to ensure the bot is working properly;
- `undeafen`: undeafens the bot, if that's actually a word;
- `unmute`: unmutes the bot.
Documentation for audio can be found at:
<https://serenity.zey.moe/serenity/ext/voice/index.html>
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
The script was made with the eventual purpose to build custom docs.
This has been replaced by [cargo-external-doc], which was released a
few days after the script was added.
Since the only other purpose of the script besides adding the image has
been fulfilled by another crate, we can just utilize a rustdoc attribute
to do this.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
The examples can already be run via `cargo run --example <filename>`,
so there's no need for bin entries for them.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These hooks will each be run prior to or after the command, and will
finish execution before executing the command.
These can be configured in a Framework via:
```rs
client.with_framework(|f| f
.before(|_context, message, _command_name| {
println!("Got command '{}'", command_name);
})
.after(|_context, _message, command_name| {
println!("Finished command '{}'", command_name);
}));
```
This does introduce a backwards compatibility break, by requiring
commands' Context/Message to be borrowed
Upgrade path:
If not using the `command!` macro, modify command signatures from:
```rs
fn some_command(context: Context, message: Message, args: Vec<String>)
```
to
```rs
fn some_command(context: &Context, message: &Message, args: Vec<String>)
```
|
| |
|
|
|
| |
Add documentation for some missing methods - such as Game methods - and
add more methods to the Message Builder.
|
| | |
|
| |
|
|
|
| |
When a guild delete is received, add its Id to the unavailable guild list,
and when a create is received, remove it.
|
| | |
|
| |
|
|
|
| |
Add documentation for Context methods, as well as brief documentation
for REST functions and model definitions.
|
| | |
|
| | |
|
| | |
|