rocketbot icon indicating copy to clipboard operation
rocketbot copied to clipboard

Suggestion: Rewrap using GitHub Probot

Open reececomo opened this issue 3 years ago • 1 comments

Something worth exploring, GitHub Probot exists and is also based on Octokit.

It cuts out all the GitHub authentication flows boilerplate, easy to write/maintain/test/extend, supports TypeScript out of the box, etc.

import { Probot } from "probot";
import { handle } from "./rocketbot";

export = (app: Probot) => {
  app.on("issue_comment.created", async (context) => {
    const updatedComment: IssueComment | undefined = handle(context)

    if (updatedComment) {
      await context.octokit.issues.updateComment(updatedComment);
    }
  });
}

reececomo avatar Aug 23 '21 04:08 reececomo