aboutsummaryrefslogtreecommitdiff
path: root/src/model
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix model doc linksAustin Hellyer2017-01-021-3/+4
|
* Fix no-cache method buildsAustin Hellyer2017-01-021-1/+3
|
* Add Message::guild() helperAustin Hellyer2016-12-311-3/+15
|
* Fix typoIllia2016-12-313-4/+4
|
* Add command alias support and command.exampletaavi?2016-12-291-2/+0
|
* Add guild and channel searchAustin Hellyer2016-12-294-8/+321
|
* Use conditional blocks over macrosAustin Hellyer2016-12-294-56/+84
|
* Add user static avatar url methodsAustin Hellyer2016-12-281-0/+16
|
* Simplify Role's Ord implAustin Hellyer2016-12-281-11/+3
|
* Support webp/gif avatarsAustin Hellyer2016-12-281-4/+24
| | | | | If the avatar hash begins with "a_", then the avatar is animated and is a GIF. Otherwise, use WEBP.
* Accept u64 shard countsAustin Hellyer2016-12-261-3/+3
|
* Match event namesAustin Hellyer2016-12-221-107/+63
|
* Simplify event decodingAustin Hellyer2016-12-221-62/+62
|
* Abstract event decoders to associated functionsAustin Hellyer2016-12-221-260/+682
| | | | | | Abstract the logic from simply `Event::decode` and `VoiceEvent::decode` to each individual event variant struct, in the form of associated `decode` functions.
* (╯°□°)╯︵ ┻━┻Austin Hellyer2016-12-191-3/+10
|
* Fix a typo in UserId::find docsAustin Hellyer2016-12-181-1/+1
|
* Fix Message::delete()Austin Hellyer2016-12-181-7/+7
|
* Expose message webhook IdsIllia2016-12-181-0/+6
|
* Add guild splash URL methodsAustin Hellyer2016-12-171-0/+23
|
* Make Id displays format u64 instead of a mentionAustin Hellyer2016-12-171-3/+3
| | | | | | Instead of mentioning the channel, role, or user on an Id display format, format its inner u64 instead. Instead, use `Id::mention()` to accomplish the equivilant.
* Fix User::avatar_url + add Id display testsAustin Hellyer2016-12-151-2/+2
| | | | | User::avatar_url was formatting the user's Id as a mention, rather than the inner u64.
* Implement command groups and bucketsIllia2016-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement command groups * change to ref mut * Implement framework API. * Remove commands field * Make it all work * Make example use command groups * Requested changes * Implement adding buckets * Add ratelimit check function * Finish everything * Fix voice example * Actually fix it * Fix doc tests * Switch to result * Savage examples * Fix docs * Fixes * Accidental push * 👀 * Fix an example * fix some example * Small cleanup * Abstract ratelimit bucket logic
* Add emoji URL generation methodsAustin Hellyer2016-12-122-0/+16
|
* More config for CreateCommand, add various methodsIllia2016-12-107-100/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | Adds multiple configurations to the command builder, and adds methods to various structs. Context::get_current_user is a shortcut to retrieve the current user from the cache. Message::get_member retrieves the member object of the message, if sent in a guild. Message::is_private checks if the message was sent in a Group or PrivateChannel. User::member retrieves the user's member object in a guild by Id; Adds 6 configurations to the command builder: - dm_only: whether the command can only be used in direct messages; - guild_only: whether the command can only be used in guilds; - help_available: whether the command should be displayed in the help list; - max_args: specify the maximum number of arguments a command must be given; - min_args: specify the minimum number of arguments a command must be given; - required_permissions: the permissions a member must have to be able to use the command;
* Fix no-cache+method conditional compilesAustin Hellyer2016-12-106-27/+35
| | | | Additionally, flag imports behind feature flags to avoid unused imports.
* Fix some clippy lintsAustin Hellyer2016-12-093-6/+6
|
* Change all try's into ?sacdenisSK2016-12-079-279/+276
| | | This breaks compatibility with < 1.13, but we didn't support that anyway.
* Allow mentionable structs to be used as command argumentsIllia2016-12-072-1/+89
| | | | | Add EmojiIdentifier, allow User, UserId, Role, RoleId, EmojiIdentifier, Channel and ChannelId to be used as arguments for commands and add more parsing functions to utils
* Improve Mentions, fix MessageBuilderIllia2016-12-066-101/+48
| | | | | Remove the obsolete Mention struct as well as related methods, improve the way mentioning works, fix the message builder, add a test for all this.
* Add more Context docs+permission requirementsAustin Hellyer2016-12-041-0/+2
| | | | | Add more documentation to most of the Context methods, also clarifying which permission/s are required for each method.
* Add documentation for modelsIllia2016-12-042-3/+7
|
* Import this import _again_Austin Hellyer2016-12-031-0/+2
|
* Make Member::colour() return an optional colourAustin Hellyer2016-12-031-18/+7
|
* Add Member::colourIllia2016-12-031-9/+34
| | | | Add a colour method to retrieve the member's top role with a unique colour, or the default colour if none can be applied.
* Add Role Eq/Ord implsAustin Hellyer2016-12-031-0/+33
| | | | | | | | | Roles can now be compared directly. This is a heirarchy check. This checks the following between two roles, A and B: - A's position is greater than B; - if not, then A's Id is greater than B; if these two conditions are false, then B is greater than A. If the two conditions are both true, then they are of equivilance.
* Add Member.colourIllia2016-12-031-0/+11
|
* Add User::distinctIllia K2016-12-031-0/+5
| | | | | The distinct method concatenates the user's name and discriminator by the hash (`#`) symbol.
* Add CurrentUser::editAustin Hellyer2016-12-031-1/+46
|
* Paginate rest::get_guilds and add helper methodsAustin Hellyer2016-12-021-0/+7
| | | | | | | | | | | | | | | | | | | | 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.
* Add Message::guild_id()Austin Hellyer2016-12-011-0/+17
| | | | | | | 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.
* Clarify some docsAustin Hellyer2016-11-301-0/+15
|
* Clean up the codebaseAustin Hellyer2016-11-297-165/+137
|
* Add initial audio supportAustin Hellyer2016-11-291-14/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Optimize for cached, non-method compilesAustin Hellyer2016-11-283-13/+8
|
* Improve docs and add new message builder methodsIllia K2016-11-284-6/+46
| | | | | Add documentation for some missing methods - such as Game methods - and add more methods to the Message Builder.
* Add Context, REST, and model documentationfwrs2016-11-272-0/+3
| | | | | Add documentation for Context methods, as well as brief documentation for REST functions and model definitions.
* Voice example no longer requires 'extras'Austin Hellyer2016-11-261-1/+0
|
* Add a bit more docsAustin Hellyer2016-11-261-0/+1
|
* Make Cache::get_channel return a referenceAustin Hellyer2016-11-262-4/+6
| | | | | | | 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-261-3/+0
| | | | | | 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.