aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Add some model docs, deprecate Role::edit_roleMaiddog2017-06-0312-35/+174
| | | Deprecate `Role::edit_role` and rename it to `Role::edit`.
* Fix compilations across feature combinationsZeyla Hellyer2017-06-0222-61/+94
|
* Add User::refreshZeyla Hellyer2017-06-021-0/+58
|
* Fix client-feature, no-model compilesZeyla Hellyer2017-06-011-3/+21
| | | | | | | Some of the methods used in the client dispatch, namely `Channel::id` and `Message::transform_content`, are not _required_ for functionality by the dispatcher. Since these methods are `model` features, they can be gated behind a `model` feature cfg.
* Fix no-feature compilationsZeyla Hellyer2017-06-011-0/+1
| | | | | | An internal `tag` function created in a previous commit is only required for use when the `"model"` feature is enabled, but the function itself was not gated behind the feature.
* Check last heartbeat acknowledged in heartbeaterZeyla Hellyer2017-06-012-4/+34
| | | | | | | | | | When heartbeating, first ensure that the previous heartbeat was acknowledged. If it wasn't, shutdown the sender and receiver so that an auto-reconnect can take place. When receiving a Heartbeat Acknowledgement, set the `last_heartbeat_acknowledged` to `true` to prevent the auto-reconnect process.
* Deprecate User::getZeyla Hellyer2017-06-011-0/+1
| | | | | | The function no longer fit's a short-lived period of serenity's design, where it would have been preferred to do `User::get(ID)` over `UserId(ID).get()`.
* Deprecate *User::distinct, add *User::tagZeyla Hellyer2017-06-011-16/+73
| | | | | | | | | | `distinct`, although accurate, is an odd name for the method. Deprecate `distinct` on `CurrentUser` and `User` and rename them to `tag`. Additionally, optimize the creation of the resultant String by about 2x. Instead of using the `format!` macro, create a new String with a capacity of 37 and push the username, `'#'`, and write the discriminator in manually.
* Fix ratelimiting::ROUTES doctestZeyla Hellyer2017-05-301-1/+1
| | | | | Values are now wrapped within an Arc<Mutex>, so the example needs to obtain a lock and unwrap it.
* Include more info on ratelimiting debugsZeyla Hellyer2017-05-301-7/+7
| | | | | In addition to the amount of time sleeping, include the route being ratelimited.
* Fix ratelimits causing 429s in certain situationsZeyla Hellyer2017-05-301-17/+18
|
* Add Content for MessageBuilderSkye2017-05-302-11/+195
| | | Allow `push` and `push_safe` to use a flexible syntax for formatting.
* Don't create group in help if no commands to showMaiddog2017-05-301-20/+15
|
* Add documentation and tests for frameworkMaiddog2017-05-303-4/+266
|
* Add cache docsMaiddog2017-05-301-0/+115
|
* Add docs for CurrentUserMaiddog2017-05-301-0/+103
|
* Add _line + _line_safe methods to MessageBuilderMaiddog2017-05-281-0/+250
| | | | | | Add new methods to MessageBuilder to push content similar to the other methods, except with the addition of appending a newline afterwards. This should help prettify some MessageBuilder usage.
* Move CreateGroup docs to the structZeyla Hellyer2017-05-281-3/+3
| | | | | The docs were on the impl, when instead they should be on the struct itself.
* Implement multiple attachmentsKen Swenson2017-05-286-0/+278
|
* impl From<char> for ReactionTypeZeyla Hellyer2017-05-281-0/+27
| | | | This can be used as a helpful shortcut for reactions.
* Add CurrentUser::invite_url methodMaiddog2017-05-271-0/+12
|
* Guild::create_channel doesn't require mutabilityZeyla Hellyer2017-05-271-1/+1
| | | | | Change `Guild::create_channel` to take a non-mutable reference, as mutability isn't required.
* Remove deprecated GuildChannel methodsZeyla Hellyer2017-05-271-51/+0
| | | | | | | | | | | | | Remove the deprecated GuildChannel methods in preparation of an incoming commit modifying GuildChannel. Remove the following deprecated methods: - `get_invites` - `get_message` - `get_messages` - `get_reaction_users` - `get_webhooks`
* Fix incorrect attempted send_file deserializationZeyla Hellyer2017-05-276-0/+38
| | | | | | | | | | | If http::send_file received a non-success status code due to reasons such as sending to an invalid channel Id, not having permissions, or sending too large of a file, then it would still try to deserialize a response as if it were valid. To fix this, ensure that the response is successful. Document that if the file sent is too large, then `HttpError::InvalidRequest(PayloadTooLarge)` is returned.
* Fix GuildChannel::create_permission anchor linkZeyla Hellyer2017-05-271-0/+1
| | | | A link to model::permissions::SEND_MESSAGES was broken.
* Fix GuildChannel::create_permission examplesZeyla Hellyer2017-05-271-14/+46
| | | | | | The examples didn't bring `model::PermissionOverwriteType` into scope. Additionally, wrap the examples in try_main's to make use of the `?` operator.
* Change create_permission to take a referenceZeyla Hellyer2017-05-272-4/+4
| | | | | {ChannelId,GuildChannel}::create_permission don't need to take ownership over the overwrite, so just accept a reference.
* Add VerificationLevel::HigherZeyla Hellyer2017-05-261-3/+6
| | | | | A new verification level was added for guilds with a value of 4, which means "Must have a verified phone on their Discord account."
* Fix broken docs links in http moduleZeyla Hellyer2017-05-241-43/+43
|
* Re-order methods/fields in the frameworkZeyla Hellyer2017-05-243-50/+50
| | | | This will help with readability in the generated documentation.
* Move Reaction struct into its proper placeZeyla Hellyer2017-05-242-20/+20
| | | | | The struct was previously in `src/model/channel/message.rs` instead of its own `src/model/channel/reaction.rs` file.
* Clippy lintsZeyla Hellyer2017-05-242-5/+4
|
* Remove unused internal macroZeyla Hellyer2017-05-241-9/+0
| | | | | The `base!` macro providing the base URI for discordapp is no longer in use and can be safely removed.
* Sort default help by group/command namesMaiddog2017-05-241-6/+26
| | | | | | | Sort the default framework help functions by their group and command names. This should act as a reasonable default for users. If other behaviour is required, users can make their own or copy and modify existing functions.
* Support adding reactions when creating messagealex2017-05-242-7/+23
| | | | These reactions are added onto the `MessageCreate` builder, and are sent after the message has been created.
* Add more examples and improve some othersZeyla Hellyer2017-05-2314-106/+1278
| | | | | Add examples to some functions, and update some of the old examples to use the `?` operator instead of unwrapping.
* Fix {Invite,RichInvite}::url testsZeyla Hellyer2017-05-221-0/+6
| | | | | Add fields in struct instantiation for the new stats fields introduced by the recent invite stats commit.
* Restructure modulesZeyla Hellyer2017-05-2276-880/+1096
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modules are now separated into a fashion where the library can be used for most use cases, without needing to compile the rest. The core of serenity, with no features enabled, contains only the struct (model) definitions, constants, and prelude. Models do not have most functions compiled in, as that is separated into the `model` feature. The `client` module has been split into 3 modules: `client`, `gateway`, and `http`. `http` contains functions to interact with the REST API. `gateway` contains the Shard to interact with the gateway, requiring `http` for retrieving the gateway URL. `client` requires both of the other features and acts as an abstracted interface over both the gateway and REST APIs, handling the event loop. The `builder` module has been separated from `utils`, and can now be optionally compiled in. It and the `http` feature are required by the `model` feature due to a large number of methods requiring access to them. `utils` now contains a number of utilities, such as the Colour struct, the `MessageBuilder`, and mention parsing functions. Each of the original `ext` modules are still featured, with `cache` not requiring any feature to be enabled, `framework` requiring the `client`, `model`, and `utils`, and `voice` requiring `gateway`. In total the features and their requirements are: - `builder`: none - `cache`: none - `client`: `gateway`, `http` - `framework`: `client`, `model`, `utils` - `gateway`: `http` - `http`: none - `model`: `builder`, `http` - `utils`: none - `voice`: `gateway` The default features are `builder`, `cache`, `client`, `framework`, `gateway`, `model`, `http`, and `utils`. To help with forwards compatibility, modules have been re-exported from their original locations.
* Reasonably derive Debug on itemsZeyla Hellyer2017-05-2216-21/+20
|
* Remove more remaining selfbot supportZeyla Hellyer2017-05-226-216/+0
| | | | We removed these a long time ago, and these were missed.
* Add `Invite::url()`, `RichInvite::url()`Zeyla Hellyer2017-05-221-0/+72
| | | | | Add helper methods to easily produce invite URLs, such as `"https://discord.gg/WxZumR"`.
* Add GuildChannel::permissions_forZeyla Hellyer2017-05-221-0/+87
| | | | Add a method to calculate a member's permissions in the channel.
* Handle message type 7 (member join)illia k2017-05-224-2/+69
| | | | | | | | | | When message type 7 is received from the gateway, transform the content if the type is 7 to a proper greeting. Additionally, when the type is 6, provide a proper content notifying that a user has pinned a message to the channel. These transformations are not done at REST-level when retrieving messages, and are instead done in `ChannelId::message` and `ChannelId::messages`.
* Add support for retrieving invites with countsMei2017-05-182-6/+25
| | | | | | | Previously retrieving an invite with the `?with_counts=true` wasn't possible. Added support to `get_invite` for retrieving an invite with the counts, this requires the user to pass true to the function. The counts include `approximate_presence_count` and `approximate_member_count` which have been added to the `Invite` stuct, as well as `text_channel_count` and `voice_channel_count` to the `InviteGuild` struct.
* Allow unreachable_code lint in command! macroKen Swenson2017-05-181-4/+4
| | | | | If a user returns at the end of a `command!` macro block, the library's return value will never be processed, as it's unreachable. Instead of warning for this, allow it.
* Don't skip everyone role when checking channel overwritesMaiddog2017-05-131-1/+1
|
* Bump to v0.2.0v0.2.0Zeyla Hellyer2017-05-131-2/+1
|
* Fix internal enum being exportedZeyla Hellyer2017-05-131-1/+0
|
* Fix no-cache framework compilationZeyla Hellyer2017-05-131-7/+14
|
* Fix unused import lintZeyla Hellyer2017-05-131-1/+2
|