Commit Graph

32 Commits

Author SHA1 Message Date
Finite Reality
efdb4f9266 Pass our json serializer to ToObject calls (#1133)
Should fix issues in audit logs when deserializing overwrites and
similar types which we use a custom contract resolver for.
2018-08-29 17:11:26 +01:00
Still Hsu
ffe994a9df Mark guild optional in invite & general invite improvement (#1094)
* Mark guild as optional for invite

* Mark partial InviteMetadata members as Optional<T>

* Some of them aren't sent when requesting through the general GET invite endpoint

* Remove GetInviteParams

* It was kinda stupid in the first place, might as well always get the count instead of having to ask the user whether they want the two fields filled or not.

* Add ChannelType property

* Add vanity invite support
2018-07-02 17:02:38 -04:00
HelpfulStranger999
79811d0e61 Paginate reactions - solved #1007 (#1022)
* Cleaned up and refactored slightly

* Resolves #971

* Adds support for default avatars and resolves #971

* Amendment

* Final amendment

* Paginating reactions

* Amendments based on feedback

* Further amendment based on review

* Final(?) amendment

* Removes default limit and after user id

* Removes fromUserId; cleans up model creation; replaces function with individual parameters
2018-05-24 18:35:38 -04:00
Finite Reality
39dffe8585 Audit Logs implementation (#1055)
* Copy audit logs impl from old branch and clean up

I suck at using git, so I'm gonna use brute force.

* Remove unnecessary TODOs

Category channels do not provide any new information, and the other
I forgot to remove beforehand

* Add invite update data, clean up after feedback

* Remove TODOs, add WebhookType enum for future use

WebhookType is a future-use type, as currently audit logs are the only
thing which may return it.
2018-05-12 20:46:07 -04:00
Still Hsu
97c893107b Implement GetBanAsync (#1056) 2018-05-06 18:22:49 -04:00
Allan
9b29c004fa Fixed GetReactionUsersAsync that was not using limit and afterUserId arguments. (#1017) 2018-04-29 11:11:44 -04:00
Still Hsu
7022149536 Fix/Implement various invite-related behaviors (#1023)
* Initial support for invite member count arg

* Fix IDiscordClient#GetInviteAsync behavior

- Previously, the GetInviteAsync method would return null since it couldn't be parsed as a simple RestInvite object. The object should be a RestInviteMetadata instead.

* Fix methods that didn't comply with the interface

* Change with_counts REST behaviour

* Remove unnecessary JSON prop

* Remove AcceptAsync
2018-04-29 11:11:05 -04:00
Quahu
55299ff14f Prevents NREs when sending/modifying messages (#993) 2018-03-23 19:49:45 -04:00
Darnell Williams
fc5e70c9dd Attempts to resolve #961 (#962)
* Move REST requests to appropiate class

* Add call to ClientHelper and expose to public API

* Expose shard count request in public api

* Expose method from interface

* Update sharded client to utilize the new method

* Method is already implemented in a base class

* Refactor name to fit pattern for methods returning a `Task`

* Adds missing ConfigureAwait

* Corrects unnecessary whitespace

* Removes unneeded whitespace
2018-03-15 18:49:25 -04:00
Christopher F
e68ef63bc6 Allow GetPrefixedToken to handle the default TokenType
This prevents an issue where no clients could be constructed.

In 2fd4f56, the case for user tokens was removed from GetPrefixedToken,
which means that the default value for TokenType would now fallthrough
to the default case, which throws an error.
2018-03-12 20:46:49 -04:00
Joe4evr
2fd4f5670e Remove support for TokenType.User (#958)
* Set usage of TokenType.User as an error rather than a warning.

* Remove commented sections and #pragma's

Additionally, changes use of ReadMessages to ViewChannel since that Obsolete was also suppressed by the pragma
2018-03-12 13:59:22 -04:00
Christopher F
9d77a3cd37 Fix parsing timestamps with a timezone attached
Resolves #918.

For some reason (that i'm sure will bite me in the ass later), we
configured Json.Net with a time format that forced UTC - even when the
API appends a timezone to the timestamp. Removing the custom time format
seems to resolve this issue.
2018-01-06 23:36:08 -05:00
Alex Gravely
7b2ddd027c Add missing REST Webhook implemenation (#843)
* Add Webhook API models, REST implementation, and Socket bridges.

* Remove token overrides from REST.

Leaving that as a Webhook package only feature.

* Add Webhook API models, REST implementation, and Socket bridges.

* Remove token overrides from REST.

Leaving that as a Webhook package only feature.

* Webhook core implementation.

* Webhook REST implementation.

* Webhook client implementation.

* Add channel bucket id.
2017-12-23 15:17:20 -05:00
Mateusz Brawański
b4bf046ad4 Implemented emoji endpoints (#835)
* Implemented emoji endpoints.

* Fixed: now using API entities for REST client.

* Removed emoji listing endpoint, as per @foxbot's request.
2017-11-20 15:02:42 -05:00
Christopher F
347c5a0d39 Disable obsolete warnings in files that reference TokenType.User 2017-09-29 17:37:07 -04:00
Christopher F
506a6c96c9 Throw when attempting to add or remove a member's EveryoneRole (#781)
* Throw when attempting to add or remove a member's EveryoneRole

This resolves #780

* Removed braces
2017-08-17 02:59:58 -03:00
Christopher F
95b78df9f0 URL-Encode reasons on Kick/Ban (#787)
This resolves #784
2017-08-17 02:43:00 -03:00
RogueException
14dfc48df3 Style cleanup 2017-06-29 19:44:32 -03:00
Christopher F
1ce1c019b3 Add support for audit log reasons (#708)
* Add support for audit log reasons

* Made changes per discussion
2017-06-29 17:01:59 -03:00
Christopher F
660d4b0bf6 Add an upper limit to prune length when banning a user (#611)
Messages may only be pruned between 0 and 7 days, otherwise a 400 will be thrown.
2017-04-15 19:03:19 -03:00
RogueException
d6b6a95a2e Renamed ClientAPIUrl -> APIUrl 2017-04-03 02:59:11 -03:00
RogueException
5e94b97024 Added RequestOptions to RestClient methods. Added guild summary paging. 2017-03-31 03:01:49 -03:00
RogueException
35d7a0cec8 Ensure UploadFile is always a seekable stream. 2017-03-22 06:08:58 -03:00
RogueException
20f7ba431f Cleaned up and fixed several reorder issues. 2017-03-20 23:48:41 -03:00
Mateusz Brawański
efbd3cb681 GuildUserExtensions removed in favour of atomic role add/remove endpoints (#540)
* Removed GuildUserExtensions and moved the methods to IGuildUser and implementations

* Made changes per fox's suggestion: Change->Modify. New Modify overload.

* Oops

* Per Volt: reimplemented new endpoints

* Fixing broken docstrings

* I forgot that docstrings are XML

* Implemented atomic add/remove role endpoints

* Removed  so people aren't irked

* Added single-item role add/remove methods
2017-03-18 08:54:49 -03:00
RogueException
587ec65e79 Added Discord.Net.Webhook 2017-03-16 05:35:01 -03:00
Christopher F
66b7e0e7f0 Rename precondition to 'YoungerThanTwoWeeks' 2017-03-01 17:16:06 -05:00
Christopher F
607f478b9a Check that messages older than two weeks are not passed to bulk delete
This resolves #477
2017-02-23 17:39:10 -05:00
RogueException
b91026f552 Stop spamming users/@me and voice/regions 2017-01-28 17:04:35 -04:00
RogueException
b76c744447 Internally exposed several ApiClient props 2017-01-24 11:38:53 -04:00
RogueException
e2934abe29 Made API models internal. Removed Discord.Net.API. 2017-01-01 23:28:42 -04:00
RogueException
8326d01f62 Isolated API definitions to their own library 2016-12-23 16:57:29 -04:00