Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require message_id for Channel#load_message #70

Merged
merged 1 commit into from
Sep 17, 2021

Conversation

mattantonelli
Copy link
Contributor

Summary

Ensures the message_id parameter of Channel#load_message is not nil since we cannot load the message without it. Calling the method with a nil value will now return a more helpful ArgumentError instead of a Discordrb::Errors::UnknownError.

Added

Added a check to Channel#load_message to ensure the message_id parameter is not nil.

Before

bot.channel(12345).message(nil)

[ERROR : main @ 2021-08-13 17:40:53.860] 404: Not Found
Discordrb::Errors::UnknownError: 404: Not Found

After

bot.channel(12345).message(nil)

ArgumentError: message_id cannot be nil

Ensures the `message_id` parameter of `Channel#load_message` is not nil
since we cannot load the message without it.
@swarley swarley merged commit a59b8fb into shardlab:main Sep 17, 2021
@swarley
Copy link
Member

swarley commented Sep 17, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants