Skip to content

Instantly share code, notes, and snippets.

@grahamc
Last active February 28, 2018 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grahamc/dad9059f0518d995cd6eaca3c073063c to your computer and use it in GitHub Desktop.
Save grahamc/dad9059f0518d995cd6eaca3c073063c to your computer and use it in GitHub Desktop.

Replace the NixOS_GitHub bot:

Write a function which accepts a single webhook event (which could be any of the events described at https://developer.github.com/webhooks/) and returns a list of messages to send to IRC.

If the webhook event should send no message, then it should return an empty list.

Preferred languages:

  1. Rust
  2. PHP
  3. Anything else, really

Example function:

function event_to_msgs($event) {
  if (isset($event['issue']) && $event['action'] == 'created) {
    return ["cool, a new issue!"];
  } else {
    return [];
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment