Skip to content

Conversation

@anoadragon453
Copy link

It wasn't clear that a webhook's event_type is specified by the decorator argument, rather than the name of the function. I tried defining:

@webhook.hook() def on_issue_comment(data): print(data) 

But this still fires for push events. Instead, if we explicitly add the argument to the decorator here, it's clear that that's the way to change which webhook event type this method fires for.

@alexchamberlain
Copy link
Contributor

Thanks for the feedback @anoadragon453 ; what do you think of leaving the example as-is, as it demonstrates the default argument and adding a second example that has the event_type specified?

@Arlington1985
Copy link

I think having event_type=push in the example is just self-explanatory

@anoadragon453
Copy link
Author

@alexchamberlain sorry, I missed your original comment!

A second example works, or just one with a comment explaining the default:

@webhook.hook(event_type="issue_comment") # event_type defaults to "push"defon_issue_comment(data): print(data)

I don't have a strong preference for either suggestion presented here, I just think one should be chosen ¯\_(ツ)_/¯

@skorokithakis
Copy link

This would have saved me quite a bit of time.

@anoadragon453
Copy link
Author

Closed as development of this repository appears to have ceased.

Sign up for freeto 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.

4 participants

@anoadragon453@alexchamberlain@Arlington1985@skorokithakis