Skip to content

A bot for discord which consumes the GitHub API and gives you updates.

License

Notifications You must be signed in to change notification settings

PhilipMantrov/discord-bot-github

 
 

Repository files navigation

Discord GitHub Bot 0.2.7

Build Status Coverage Status

Preview

GitHub bot in Discord

Requirements

Usage

Command line - global

npm install -g discord-bot-github

discord-bot-github /path/to/config.json

Command line - local

mkdir somedirectory

npm install --save discord-bot-github

node ./node_modules/discord-bot-github config.json

config.js[on] options listed below

Features

  • Sweet avatar
  • Multiple Discord servers
  • Multiple Discord channels
  • Customise events subscribed to on a per-channel basis
  • Subscribe to users instead of just repositories
  • Electron based configuration wrapper for those who don't like JSON

Events

  • CommitCommentEvent - Triggered when a commit comment is created.
  • CreateEvent - Represents a created repository, branch, or tag.
    • Repository
    • Branch
    • Tag
  • DeleteEvent - Represents a deleted branch or tag.
    • Repository
    • Branch
    • Tag
  • DeploymentEvent - Represents a deployment.
  • DeploymentStatusEvent - Represents a deployment status.
  • ForkEvent - Triggered when a user forks a repository.
  • GollumEvent - Triggered when a Wiki page is created or updated.
  • IssueCommentEvent - Triggered when an issue comment is created on an issue or pull request.
  • IssuesEvent - Triggered when an issue is assigned, unassigned, labeled, unlabeled, opened, closed, or reopened.
  • MemberEvent - Triggered when a user is added as a collaborator to a repository.
  • MembershipEvent - Triggered when a user is added or removed from a team.
  • PageBuildEvent - Represents an attempted build of a GitHub Pages site, whether successful or not.
  • PublicEvent - Triggered when a private repository is open sourced. Without a doubt: the best GitHub event.
  • PullRequestEvent - Triggered when a pull request is assigned, unassigned, labeled, unlabeled, opened, closed, reopened, or synchronized.
    • Assigned
    • Unassigned
    • Labeled
    • Unlabeled
    • Opened
    • Closed
    • Reopened
    • Synchronized
  • PullRequestReviewCommentEvent - Triggered when a comment is created on a portion of the unified diff of a pull request.
  • PushEvent - Triggered when a repository branch is pushed to.
  • ReleaseEvent - Triggered when a release is published.
  • RepositoryEvent - Triggered when a repository is created.
  • StatusEvent - Triggered when the status of a Git commit changes.
  • TeamAddEvent - Triggered when a repository is added to a team.Triggered when a repository is added to a team.
  • WatchEvent - The WatchEvent is related to starring a repository, not watching.

config.js[on]

Example

{
  "interval": 5000,
  "email": "[email protected]",
  "password": "xxxxxxxxxxxxxx",
  "token": "c6c859bd79aa5ad9d88d62247a534e1e76273dcd",
  "avatar": "somebase64image",
  "subscriptions": [
    {
      "repository": "Falconerd/multiply",
      "servers": [
        {
          "id": "125472919223664640",
          "invite": "http://discord.gg/1234567890",
          "channels": [
            {
              "name": "github",
              "events": [
                "Push",
                "PullRequest"
              ]
            }
          ]
        }
      ]
    }
  ]
}
Key Description
interval Time in milliseconds to check the GitHub API.
email Discord email associated with your bot's account.
password Plain text password for your Discord bot's account.
token GitHub OAuth token generated from your settings.
avatar Base64 string of an image.
subscriptions Array of subscriptions. Outlined below.

Subscriptions

Key Description
repository The repository. Must be as such username/repository.
servers The servers in which to post activity of this repository. Outlined below.

Servers

Key Description
id The Discord server ID.
invite Invite link to the server.
channels Which channels to post to. Outlined below.

Channels

Key Description
name The name of the channel.
events Which events to post to this channel.

Events must be of the following: Push, CommitComment, PullRequest, Issues, IssueComment, Create, Delete

See the Events section above for which events are currently available.

About

A bot for discord which consumes the GitHub API and gives you updates.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%