Skip to content

dismob/github

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Github Webhook Endpoint

This is a dismob plugin which creates an endpoint server to receive github webhooks.

You can then configure how you want the bot using the added slash commands to post messages in your discord server when webhooks are received.

Installation

Important

You need to have an already setup dismob bot. Follow the instruction there to do it first.

Just download/clone (or add as submodule) this repo into your dismob's plugins folder.
The path must be YourBot/plugins/github/main.py at the end.

The default port of the endpoint is 8080, but you can configure it by defining WEBHOOK_PORT in your .env file.
You can also define the webhook secret by setting the WEBHOOK_SECRET value in your .env file.

Something like that:

WEBHOOK_PORT="5555"
WEBHOOK_SECRET="your webhook secret"

Once your bot is up and live, run those commands on your discord server:

!modules load github
!sync

Note

Replace the prefix ! by your own bot prefix when doing those commands!

Then you can reload your discord client with Ctrl+R to see the new slash commands.

Commands

Command Description
/github webhook-settings <webhook event> [params ...] Create or update settings for a specific webhook event. If no parameters are passed, display the current settings for the event.
/github enable-webhook-event <webhook event> <enable> Enable or disable a specific webhook event

You can use any data sent by the webhook in your title and messages. For example, a release.published event will have some data about the release and its repo.
For example, release[html_url] will holds the link to the github release, and release[name] will holds the name of the github release.

An example command:

/github webhook-settings event:release.published title:{release[name]} message:New release! :tada: \nGet it [here]({release[html_url]})

Contributors

Languages