Fixes NRE when request size is too large.
Created by: Neuheit
Summary
This PR mainly fixes #417 (closed), but also adds an initial check and makes a few documentation/output changes.
Details
If a user tries to upload a file that is greater than the limit, Discord will return code 413: "Request entity too large". Previously, the lib does not handle this, and instead assumes the request succeeded and tries to parse the first property of the message class, which throws the NRE.
This PR adds this code to the exception list, and throws a custom exception that states the user's request size was too large.
Additionally, I removed a few checks in DiscordChannel.RespondAsync() as the same checks are in DiscordApiClient.CreateMessageAsync(), I added a check when sending multiple files to ensure the user does not send more than 10, and I also added punctuation on a few error messages.
Changes proposed
- Created a new exception, which properly throws when a request size becomes too large.
- Added/deleted a few checks in various methods for simplicity, and added a check for file count.
- Added punctuation at the end of a few error messages.