Skip to content

Commit 29403d7

Browse files
Merge pull request #8 from barrymichaeldoyle/feat/discord-bot
feat: implemented discord bot
2 parents e08053d + 10c3881 commit 29403d7

32 files changed

Lines changed: 1642 additions & 69 deletions

packages/action/examples/patch-pulse-bot.yml renamed to packages/action/examples/patchpulse.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Example: add this file to your repo at .github/workflows/patch-pulse-bot.yml
1+
# Example: add this file to your repo at .github/workflows/patchpulse.yml
22
#
33
# This workflow runs PatchPulse weekly and opens one PR per outdated package (or
44
# package group). PRs include the version diff, release notes links, a
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
2-
3-
export default new Map([]);
4-
1+
export default new Map();

packages/docs/.astro/content-modules.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export default new Map([
44
["src/content/docs/cli/commands.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fcli%2Fcommands.mdx&astroContentModuleFlag=true")],
55
["src/content/docs/cli/configuration.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fcli%2Fconfiguration.mdx&astroContentModuleFlag=true")],
66
["src/content/docs/cli/overview.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fcli%2Foverview.mdx&astroContentModuleFlag=true")],
7+
["src/content/docs/discord-bot.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fdiscord-bot.mdx&astroContentModuleFlag=true")],
78
["src/content/docs/github-action/configuration.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fgithub-action%2Fconfiguration.mdx&astroContentModuleFlag=true")],
89
["src/content/docs/github-action/overview.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fgithub-action%2Foverview.mdx&astroContentModuleFlag=true")],
910
["src/content/docs/index.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Findex.mdx&astroContentModuleFlag=true")],

packages/docs/.astro/data-store.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

packages/docs/astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export default defineConfig({
5151
],
5252
},
5353
{ label: 'Slack Bot', link: '/slack-bot' },
54+
{ label: 'Discord Bot', link: '/discord-bot' },
5455
],
5556
}),
5657
],
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
interface Props {
3+
href: string;
4+
}
5+
6+
const { href } = Astro.props;
7+
---
8+
9+
<a class="discord-button" href={href}>
10+
<span class="discord-button__label">Add to Discord</span>
11+
</a>
12+
13+
<style>
14+
.discord-button {
15+
display: inline-flex;
16+
align-items: center;
17+
justify-content: center;
18+
min-height: 2.75rem;
19+
padding: 0.75rem 1.1rem;
20+
margin: 1rem 0 1.5rem;
21+
border-radius: 0.75rem;
22+
border: 1px solid rgba(255, 255, 255, 0.12);
23+
background:
24+
linear-gradient(180deg, #6a75f7 0%, #5865f2 100%);
25+
box-shadow:
26+
0 12px 28px rgba(88, 101, 242, 0.28),
27+
inset 0 1px 0 rgba(255, 255, 255, 0.14);
28+
color: #fff;
29+
font-weight: 700;
30+
font-size: 0.95rem;
31+
line-height: 1;
32+
letter-spacing: 0.01em;
33+
text-decoration: none;
34+
transition:
35+
transform 160ms ease,
36+
box-shadow 160ms ease,
37+
filter 160ms ease;
38+
}
39+
40+
.discord-button:hover {
41+
transform: translateY(-1px);
42+
box-shadow:
43+
0 16px 36px rgba(88, 101, 242, 0.34),
44+
inset 0 1px 0 rgba(255, 255, 255, 0.18);
45+
filter: brightness(1.03);
46+
}
47+
48+
.discord-button:focus-visible {
49+
outline: 2px solid #e0e3ff;
50+
outline-offset: 3px;
51+
}
52+
53+
.discord-button__label {
54+
white-space: nowrap;
55+
}
56+
</style>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Discord Bot
3+
description: Get Discord notifications for new package releases in your server channels.
4+
---
5+
6+
import { Aside } from '@astrojs/starlight/components';
7+
import AddToDiscordButton from '../../components/AddToDiscordButton.astro';
8+
9+
The Patch Pulse Discord Bot notifies your server whenever a package you depend on releases a new version.
10+
11+
<AddToDiscordButton href="https://grand-yak-92.convex.site/discord/install" />
12+
13+
<Aside type="note">
14+
Discord currently gets the base release notification flow. GitHub link
15+
backfill and AI-generated release summaries remain Slack-only for now.
16+
</Aside>
17+
18+
## How it works
19+
20+
Once installed, the bot monitors packages you care about and sends a Discord message when a new version is published to the npm registry.
21+
22+
Discord tracking is channel-based:
23+
24+
- every subscription targets an explicit channel
25+
- the same package can be tracked in multiple channels
26+
- filters can be set to patch, minor, or major updates
27+
28+
## Slash commands
29+
30+
Use these commands in your server:
31+
32+
- `/npmtrack package:react`
33+
- `/npmtrack package:react channel:#frontend`
34+
- `/npmtrack package:react filter:minor`
35+
- `/npmuntrack package:react`
36+
- `/npmuntrack package:react channel:#frontend`
37+
- `/npmlist`
38+
39+
Command responses are ephemeral, while update notifications are posted into the subscribed channel.
40+
41+
## Install and setup
42+
43+
To add Patch Pulse to your server:
44+
45+
- open [grand-yak-92.convex.site/discord/install](https://grand-yak-92.convex.site/discord/install)
46+
- choose the target server
47+
- approve the requested permissions
48+
49+
If you are self-hosting Patch Pulse rather than using the hosted bot, the Discord app setup and environment configuration live in the notifier package docs, not the public user docs site.
50+
51+
## Slack vs Discord
52+
53+
Slack and Discord support the same core package tracking model, but there are a few operational differences:
54+
55+
- Slack has a workspace default channel; Discord does not
56+
- Slack receives delayed GitHub link backfill and AI summaries; Discord currently does not
57+
- Discord commands use typed slash-command options instead of Slack's free-text command parsing

packages/docs/src/content/docs/github-action/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The Patch Pulse GitHub Action runs on a schedule, detects outdated dependencies
3535

3636
## Quick start
3737

38-
Add the following workflow to your repository at `.github/workflows/patch-pulse-bot.yml`:
38+
Add the following workflow to your repository at `.github/workflows/patchpulse.yml`:
3939

4040
```yaml
4141
name: PatchPulse Dependency Bot

packages/docs/src/content/docs/index.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ import { CardGrid, LinkCard } from '@astrojs/starlight/components';
3434
href="./slack-bot"
3535
description="Get Slack release alerts with GitHub release links and AI-generated summaries for tracked packages."
3636
/>
37+
<LinkCard
38+
title="Discord Bot"
39+
href="./discord-bot"
40+
description="Get Discord release alerts in your server channels for the packages you track."
41+
/>
3742
<LinkCard
3843
title="VS Code Extension"
3944
href="./vscode/overview"

packages/docs/src/content/docs/introduction.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Patch Pulse is a suite of tools that help you keep your npm dependencies up to d
1313
| [GitHub Action](../github-action/overview) | Automatically open PRs for outdated dependencies on a schedule |
1414
| [VS Code Extension](../vscode/overview) | Inline version information directly in your `package.json` files |
1515
| [Slack Bot](../slack-bot) | Get Slack release alerts with GitHub release links and AI summaries |
16+
| [Discord Bot](../discord-bot) | Get Discord release alerts in your server channels |
1617

1718
## Core concepts
1819

0 commit comments

Comments
 (0)