aboutsummaryrefslogtreecommitdiff
path: root/src/model
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix #130acdenisSK2017-07-221-1/+2
| | | | Removed action support from the builtin one as well, due to it adding some uneccassery complexity and it being only asked upon by one user
* match -> and_thenacdenisSK2017-07-211-4/+1
|
* Fix the tests (#129)Bond-0092017-07-211-1/+1
|
* Utilise the newly stabilised loop-with-break-valueacdenisSK2017-07-201-13/+7
|
* Add an actual way to fetch audit log entries from a guildacdenisSK2017-07-204-0/+248
|
* Implement the new way of knowing some channels as "nsfw"acdenisSK2017-07-181-1/+14
|
* Fix GuildChannel::permissions_for doctestsZeyla Hellyer2017-07-151-5/+5
|
* Fix more doc testsacdenisSK2017-07-142-2/+2
|
* Fix the doc on `PrivateChannel::name`acdenisSK2017-07-141-1/+1
|
* Add `ChannelId,PrivateChannel,GuildChannel::name` functionsacdenisSK2017-07-143-0/+33
|
* Improve `BanOptions` to be more efficient and remove uneccessary `Read` importsacdenisSK2017-07-136-19/+9
|
* Remove the deprecated functionsacdenisSK2017-07-1113-740/+0
| | | | It's already been enough time for people to migrate
* Rename `online_members` to `members_with_status` and compare the status ↵acdenisSK2017-07-101-3/+3
| | | | provided to the function instead
* Return an error if the reason the user provided exceeded the limitacdenisSK2017-07-102-2/+14
|
* Use a trait way of overloading the `ban` function instead of an enumacdenisSK2017-07-102-52/+37
| | | | Possibly removes some overhead introduced by enums but makes the underlaying code of the function easier to read and is more concise
* Fixed clippy warnings (#120)Kaidan2017-07-101-3/+3
|
* Make `User` and `Ban` comparable and hashableacdenisSK2017-07-102-2/+2
|
* Add a way to return all online members in a guildacdenisSK2017-07-091-0/+18
|
* Remove the note from the comment on `reason`acdenisSK2017-07-081-3/+0
| | | | Audit log works and does give a reason, so this note is just false info
* Implement attaching reasons to bansacdenisSK2017-07-082-7/+67
|
* Fix doc testsacdenisSK2017-07-025-143/+175
|
* Fixed clippy warnings (#118)Kaidan2017-06-281-1/+1
|
* Docs fixesmei2017-06-2710-32/+20
|
* Add missing ModelError variant in description implZeyla Hellyer2017-06-271-0/+1
|
* Prevent Direct Messaging other bot usersZeyla Hellyer2017-06-262-0/+19
| | | | | | The API no longer allows bot users to Direct Message other bot users, so pre-emptively check that the recipient is not a bot. If it is, return a `ModelError::MessagingBot`.
* Fix ModelError doctestZeyla Hellyer2017-06-251-0/+3
|
* Fix no-feature testsZeyla Hellyer2017-06-242-1/+14
|
* Make Message::nonce a serde_json::ValueZeyla Hellyer2017-06-233-81/+3
| | | | | | | | | | | | | | | | | | Nonces can actually be almost anything - including booleans - so just use a Value to represent it since very few users will need it. This fixes errors like: ``` WARN:serenity::internal::ws_impl: (╯°□°)╯︵ ┻━┻ Error decoding: {"t":"MESSAGE_CREATE","s":12187872,"op":0,"d":{"type":0,"tts":false,"timestamp":"2017-06-01T01:00:00.000000+00:00","pinned":false,"nonce":"","mentions":[{"username":"redacted","id":"redacted","discriminator":"redacted","avatar":"redacted"}],"mention_roles":[],"mention_everyone":false,"id":"redacted","embeds":[],"edited_timestamp":null,"content":"redacted","channel_id":"redacted","author":{"username":"redacted","id":"redacted","discriminator":"redacted","bot":true,"avatar":"redacted"},"attachments":[]}} ERROR:serenity::client: Shard handler received err: Json(ErrorImpl { code: Message("Unknown i64 value: "), line: 0, column: 0 }) ``` and: ``` WARN:serenity::internal::ws_impl: (╯°□°)╯︵ ┻━┻ Error decoding: {"t":"MESSAGE_CREATE","s":1001192,"op":0,"d":{"type":0,"tts":false,"timestamp":"2017-06-01T01:01:01.000000+00:00","pinned":false,"nonce":true,"mentions":[],"mention_roles":[],"mention_everyone":false,"id":"redacted","embeds":[],"edited_timestamp":null,"content":"bork","channel_id":"redacted","author":{"username":"redacted","id":"redacted","discriminator":"redacted","bot":true,"avatar":"redacted"},"attachments":[]}} ERROR:serenity::client: Shard handler received err: Json(ErrorImpl { code: Message("invalid type: boolean `true`, expected identifier"), line: 0, column: 0 }) ```
* Update dependenciesZeyla Hellyer2017-06-211-28/+28
|
* Add 'wait' parameter to http::execute_webhookZeyla Hellyer2017-06-201-4/+5
| | | | | | The 'wait' parameter allows you to specify waiting for the Message to be sent prior to receiving a response, which will have Discord include the JSON representation of the Message in the body.
* Fix broken docs links on Permissions structZeyla Hellyer2017-06-171-5/+5
|
* Deprecate a couple Channel methodsZeyla Hellyer2017-06-171-0/+2
| | | | | | | Deprecate `Channel::delete_messages` and `Channel::delete_permission`. These methods aren't available on all of the variants' types, so they shouldn't be on the Channel either.
* Fix broken link from ModelErrorZeyla Hellyer2017-06-141-0/+1
|
* Make EmbedFooter icon URLs optionalZeyla Hellyer2017-06-141-2/+2
|
* Add `Member::permissions`alex2017-06-141-0/+27
|
* Switch from #[doc(hidden)] to pub(crate)alex2017-06-142-9/+8
| | | | | | Switch from using `#[doc(hidden)]` to hide some internal functions to `pub(crate)`. The library now requires rustc 1.18.
* Fix CurrentUser::invite_urlKen Swenson2017-06-131-14/+61
| | | Use the client ID instead of the user ID.
* Make Member::guild_id non-optionalZeyla Hellyer2017-06-132-63/+23
| | | | All codepaths result in Some value, so it doesn't need to be optional.
* Deserialize embed footersZeyla Hellyer2017-06-101-0/+2
|
* Fix negative nonces failing to deserializeZeyla Hellyer2017-06-103-3/+83
| | | | | | | | | | Negative message nonces caused deserialization errors, as serde would not deserialize integers into strings. To fix this, change `Message::nonce` into an `Option<Snowflake>` from an `Option<String>`. This new `Snowflake` is a wrapper around an `i64`. Use a new `I64Visitor` to deserialize i64s, u64s, and strs into the wanted i64.
* Deprecate Client::login, add Client::newZeyla Hellyer2017-06-065-8/+8
|
* Add User::direct_message exampleZeyla Hellyer2017-06-061-4/+26
|
* Make User::direct_message/dm accept a builderZeyla Hellyer2017-06-061-13/+10
| | | | | | Instead of accepting a `&str`, make `User::direct_message` and `User::dm` accept a `CreateMessage` builder for consistency with related functions.
* Use chrono for struct timestamp fieldsZeyla Hellyer2017-06-0610-32/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add CurrentUser::face(), User::face()Zeyla Hellyer2017-06-041-0/+24
| | | | | These functions return the user's avatar URL, or their default avatar URL as a fallback.
* Alphabetize CurrentUser/User methodsZeyla Hellyer2017-06-041-35/+35
|
* Fix links to ChannelId::send_filesZeyla Hellyer2017-06-044-8/+8
| | | | | | Helper methods such as `GuildChannel::send_files` linked to the documentation for `ChannelId::send_file`, when they should be linking to `ChannelId::send_files`.
* Make http::AttachmentType only use borrowed valuesZeyla Hellyer2017-06-045-11/+11
| | | | | With the way AttachmentType is meant to be used by `http::send_files`, none of the values need to be moved, they only need to be borrowed.
* Remove a FQN usage in User::refreshZeyla Hellyer2017-06-041-1/+1
| | | | | Instead of fully qualifying the namespace when using `std::mem::replace`, use just `mem::replace`.
* Move user avatar method logic outZeyla Hellyer2017-06-041-26/+34
| | | | | | The logic for the `User` and `CurrentUser` avatar methods (`avatar_url`, `default_avatar_url`, `static_avatar_url`) were duplicated, so move the logic out and have each method simply call the related function.