A command for a discord bot to send private pull requests with a rich preview in Discord.
This repo contains:
- Multiple installable cogs for your Discord bot:
PullRequestsReplacer: Automatically replaces GitHub PR URLs with a rich preview using a webhook (mimics the original user).PullRequestsReplier: Responds to GitHub PR URLs with a rich preview.PullRequestsCommand: Provides the/pull_requestslash command.
- A simple Discord bot that already includes the
PullRequestsReplacercog.
An example of the rich preview when using PullRequestsReplacer (but the same embed is used in three cogs):
- Populate .env:
cp .env.sample .env - Fill the .env with as desired (requires
GITHUB_TOKENand eitherALLOWED_REPO_NAMESorALLOWED_ORGANIZATIONS) - Run bot:
make
If you are using PullRequestsReplacer or PullRequestsReplier, simply paste a GitHub Pull Request URL in a message.
If you are using PullRequestsCommand:
/pull_request https://github.com/owner/repo/pull/123
- Install the library:
pip install https://github.com/EnriqueSoria/github_discord.git- Instantiate the cog and add it to your bot. See src/main.py for an example.
