Skip to content

Fail fast when attempting to send an invalid message

Mateusz Brawański requested to merge github/fork/uwx/patch-59 into master

Created by: uwx

Summary

Throws an exception when calling channel.SendMessageAsync with invalid arguments, rather than letting the request go through and fail with a 400.

Changes proposed

  • Throw ArgumentNullException in channel.SendMessageAsync when neither valid content or embed is provided.
  • Throw ArgumentException in channel.SendMessageAsync when attempting to send message >2000 characters in length.

Notes

I don't know if the lack of error checking was intentional or not

Merge request reports

Loading