aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Simplify colour macroAustin Hellyer2016-12-011-3/+2
|
* Re-order dark_green colour alphabeticallykhazhyk2016-12-011-2/+2
|
* Capitalize the hex value for blitz_blueKisei2016-11-301-1/+1
|
* Add documentation for EditMember and EditProfileKisei2016-11-302-0/+15
|
* Make command macro functions publicAustin Hellyer2016-11-301-2/+2
| | | | This will allow the command macro to be used in sub-modules.
* Fix start_integration_syncabalabahaha2016-11-301-2/+2
|
* Add blitz blue colorCrawl2016-11-301-0/+2
|
* Add Blurple to Colour listGetRektByMe2016-11-301-0/+2
| | | | Add a Blurple colour with RGB value 114,137,218.
* Add kerbal colourindiv02016-11-301-0/+2
|
* Re-order example Cargo.toml'sAustin Hellyer2016-11-301-1/+2
|
* Example should be no-runAustin Hellyer2016-11-301-1/+1
|
* Update readme exampleAustin Hellyer2016-11-301-1/+1
|
* Move the example in the readmeAustin Hellyer2016-11-301-29/+32
|
* Clarify some docsAustin Hellyer2016-11-304-45/+124
|
* Add remaining REST routesAustin Hellyer2016-11-303-8/+85
| | | | | | 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.
* Add documentation for examplesAustin Hellyer2016-11-292-9/+59
| | | | | | | | 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.
* Clean up the codebaseAustin Hellyer2016-11-2926-630/+309
|
* Add initial audio supportAustin Hellyer2016-11-2913-175/+586
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Remove duplicated gateway logicAustin Hellyer2016-11-293-37/+11
|
* Retrieve a new URL on reconnectAustin Hellyer2016-11-291-2/+4
|
* Use html_logo_url instead of a doc scriptAustin Hellyer2016-11-291-0/+1
| | | | | | | | | | 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.
* Add missing REST methodsAustin Hellyer2016-11-281-3/+31
|
* Re-order message builder fileAustin Hellyer2016-11-281-22/+21
|
* Optimize for cached, non-method compilesAustin Hellyer2016-11-283-13/+8
|
* Fix doctestsAustin Hellyer2016-11-282-4/+4
|
* Fix some clippy lintsAustin Hellyer2016-11-281-7/+7
|
* Add before/after framework command hooksIllia K2016-11-282-5/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>) ```
* Improve docs and add new message builder methodsIllia K2016-11-2815-89/+262
| | | | | Add documentation for some missing methods - such as Game methods - and add more methods to the Message Builder.
* Correctly track Cache's unavailable guildsAustin Hellyer2016-11-271-0/+6
| | | | | When a guild delete is received, add its Id to the unavailable guild list, and when a create is received, remove it.
* Re-export CreateEmbedFooterKisei2016-11-271-0/+1
|
* Add Context, REST, and model documentationfwrs2016-11-274-4/+205
| | | | | Add documentation for Context methods, as well as brief documentation for REST functions and model definitions.
* Make send_file use the CreateMessage builderAustin Hellyer2016-11-272-15/+38
|
* Voice example no longer requires 'extras'Austin Hellyer2016-11-262-7/+2
|
* Add a bit more docsAustin Hellyer2016-11-2613-25/+592
|
* Make Cache::get_channel return a referenceAustin Hellyer2016-11-265-10/+32
| | | | | | | Additionally, allow it to search the groups' and private channels' maps in the cache. As these are usually O(1) operations, it's cheap to allow, in comparison to the current unoptimized method of getting a guild's channel.
* Remove the 'extras' feature flagAustin Hellyer2016-11-265-65/+4
| | | | | | There aren't many things behind this flag (6), and it only causes annoyances for locally-generated docs, which won't show these mostly-useful items behind the flag.
* Tiny import re-orderAustin Hellyer2016-11-261-2/+1
|
* Add no-named-argument command macro matchAustin Hellyer2016-11-261-1/+37
|
* Add Cache::get_guild_channelAustin Hellyer2016-11-261-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an 'extras'-enabled function to get a guild's channel. This will allow a simple Option pattern match over the result, rather than working with an Option<Channel<T>>. Example of old code vs. new code, in the context of an event handler: Old: ```rs use serenity::cache::CACHE; use serenity::model::Channel; let cache = CACHE.read().unwrap(); let channel = match cache.get_channel(channel_id) { Some(Channel::Guild(channel)) => channel, Some(Channel::Private(_)) => { context.say("Groups and DMs not supported") .map_err(|x| println!("Err sending message: {:?}", why); return; }, None => { context.say("Could not find channel") .map_err(|x| println!("Err sending message: {:?}", x); return; }, } ``` New: ```rs use serenity::cache::CACHE; let cache = CACHE.read().unwrap(); let channel = match cache.get_guild_channel(channel_id) { Some(channel) => channel, None => { context.say("Could not find channel") .map_err(|x| println!("Err sending message: {:?}", x)); return; }, }; ```
* More widely support no-cache method compilesAustin Hellyer2016-11-255-115/+174
| | | | | | | Conditional compiles with the 'methods' feature enabled - but the 'cache' feature disabled - were supported, but methods would call an empty function to check if the current user has permissions. Instead, put these function calls behind macros which check for feature cfgs.
* Catch some clippy lintsAustin Hellyer2016-11-251-3/+0
|
* Move events into their own moduleAustin Hellyer2016-11-2511-839/+865
| | | | | | | | | | | | | | | | | | | | The events were cluttering the `model` module, and so are now moved into their own `model::event` module. As users should not usually have to work with events all that much - only currently in some rarely used event handlers - this change should not be much more effort to import from. i.e.: ```rs use serenity::model::event::ChannelPinsAckEvent; ``` vs. the now-old: ```rs use serenity::model::ChannelPinsAckEvent; ```
* Rename PublicChannel to GuildChannelAustin Hellyer2016-11-2512-78/+78
|
* Fix permission check on Message::deleteAustin Hellyer2016-11-251-8/+2
|
* Rename the `http` module to `rest`Austin Hellyer2016-11-2516-222/+222
|
* Allow compiling with only either cache or methodsAustin Hellyer2016-11-246-68/+103
| | | | | | | | | Some of the methods relied on the cache being present. Now, these methods only conditionally require the cache to be compiled and present. The cache was mainly used for checking if the current user had permission to perform operations.
* Rename guild structs to Guild and PartialGuildAustin Hellyer2016-11-2413-69/+83
|
* Ignore WebSocketError::NoDataAvailableAustin Hellyer2016-11-231-0/+2
| | | | | | | This may turn out to be a bad idea, but this causes a reconnect, as part of the catch-all `rust-websocket` crate error handling. Since this variant in particular doesn't seem directly harmful to ignore, it may be better to just throw away than to reconnect.
* Ensure embed fields are inline by defaultAustin Hellyer2016-11-231-1/+1
| | | | | | | 90% of use cases require embed fields to be inlined, so it's a better default. Also this makes the documentation accurate.
* Update doctest to use new CacheAustin Hellyer2016-11-221-1/+1
|