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

fix(GuildEmojiManager): check for guild in methods that use it #4886

Merged
merged 2 commits into from
Oct 17, 2020
Merged

fix(GuildEmojiManager): check for guild in methods that use it #4886

merged 2 commits into from
Oct 17, 2020

Conversation

vaporoxx
Copy link
Contributor

@vaporoxx vaporoxx commented Oct 4, 2020

Please describe the changes this PR makes and why it should be merged:

Client#emojis and Guild#emojis both return a GuildEmojiManager, however the current code base does not account for former not having a valid guild property. client.emojis.create(...) before resulted in DiscordAPIError: 405: Method Not Allowed, this PR aims to fix that by checking if a guild is present before using it for methods and throwing a custom error.

Consideration

There's also the option to create two separate classes for Client#emojis and Guild#emojis, I've decided to take this approach for now but I'm open to suggestions.

Status

  • Code changes have been tested against the Discord API
  • I know how to update typings and have done so

Semantic versioning classification:

  • This PR changes the library's interface (methods or parameters added)
    • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
  • This PR only includes non-code changes, like changes to documentation, README, etc.

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.

None yet

2 participants