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

Addition of ClientUtil#webhook #78

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Addition of ClientUtil#webhook #78

wants to merge 3 commits into from

Conversation

Fyko
Copy link

@Fyko Fyko commented Sep 12, 2019

This PR adds the ClientUtil#webhook function which will parse a webhook URL and return a WebhookClient.

const id = parts[parts.length - 2];
const token = parts[parts.length - 1];
if (!id || !token) return null;
return new WebhookClient(parts[parts.length - 2], parts[parts.length - 1]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return new WebhookClient(parts[parts.length - 2], parts[parts.length - 1]);
return new WebhookClient(id, token);

You already have token and id stored in variables, so there's no need to pull from the array again

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

Successfully merging this pull request may close these issues.

None yet

3 participants