Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c1a833a
feat(discord): add provider types and config
invisicat Jun 16, 2026
8a61f61
feat(discord): add client, request verification, and space resolution
invisicat Jun 16, 2026
6d5647c
feat(discord): add inbound message and media handling
invisicat Jun 16, 2026
c91f6c7
feat(discord): add outbound message building and sending
invisicat Jun 16, 2026
9eb6b56
feat(discord): wire up provider entrypoint and register in providers …
invisicat Jun 16, 2026
61e9336
refactor(discord): extract utility functions from client into util.ts
invisicat Jun 16, 2026
a32667a
chore(discord): remove debug console.log from message handler
invisicat Jun 16, 2026
bb58a65
chore(discord): use published @photon-ai/discord-ts ^10.0.0
invisicat Jun 16, 2026
c025e78
feat(discord): handle MESSAGE_UPDATE as inbound edits
invisicat Jun 16, 2026
1d7def9
feat(discord): map deletes and reaction removals to unsends
invisicat Jun 16, 2026
fbb6e2e
feat(discord): send polls as native Discord polls
invisicat Jun 16, 2026
333caa4
feat(discord): surface inbound poll messages and votes
invisicat Jun 16, 2026
f8d941e
feat(platform): thread instance actions through the fusor definePlatf…
invisicat Jun 16, 2026
db74a35
feat(discord): add thread-start REST client helpers
invisicat Jun 16, 2026
398e3f2
feat(discord): create threads via startThread/createThread instance a…
invisicat Jun 16, 2026
bf0c426
docs(discord): document the Discord provider
invisicat Jun 16, 2026
84af00e
feat(discord): send rich embeds via Discord-scoped embed() content
invisicat Jun 16, 2026
e2aa668
feat(discord): control mentions via config.allowedMentions, default r…
invisicat Jun 16, 2026
21a5aec
feat(discord): send interactive components via Discord-scoped compone…
invisicat Jun 16, 2026
dd96240
feat(discord): pin/unpin messages via instance actions
invisicat Jun 16, 2026
7c3531e
feat(discord): receive component interactions via INTERACTION_CREATE
invisicat Jun 17, 2026
55b0df6
fix(discord): tag embed/components content with DISCORD_PLATFORM so d…
invisicat Jun 17, 2026
4955117
style(discord): sort imports in components test
invisicat Jun 17, 2026
a74bf6f
docs(discord): document components, mentions, pin/unpin, and interact…
invisicat Jun 17, 2026
14def20
fix(discord): register discord provider in tsup entry list
invisicat Jun 17, 2026
9cbd57d
fix(discord) - is me auto set to false and not as bots.
invisicat Jun 17, 2026
3d4ce97
docs(discord) - fix wording on test harness for networks
invisicat Jun 17, 2026
11d6096
Merge main into andy/discord-provider
invisicat Jun 18, 2026
fda23c1
make config errors more succinct
invisicat Jun 18, 2026
a7b1d67
style(discord): wrap applicationId regex to satisfy formatter
invisicat Jun 18, 2026
ac8a400
Merge remote-tracking branch 'origin/main' into andy/discord-provider
invisicat Jun 19, 2026
08abd26
feat(discord): handle universal `app` content as a bare auto-embeddin…
invisicat Jun 19, 2026
1d58e0d
feat(discord): structured logging across verify, inbound, outbound, a…
invisicat Jun 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Visit **[docs.photon.codes](https://docs.photon.codes)** to view the full docume
| WhatsApp Business | [`@spectrum-ts/whatsapp-business`](https://npmjs.com/package/@spectrum-ts/whatsapp-business) |
| Telegram | [`@spectrum-ts/telegram`](https://npmjs.com/package/@spectrum-ts/telegram) |
| Slack | [`@spectrum-ts/slack`](https://npmjs.com/package/@spectrum-ts/slack) |
| Discord | [`@spectrum-ts/discord`](https://npmjs.com/package/@spectrum-ts/discord) |
| Terminal | [`@spectrum-ts/terminal`](https://npmjs.com/package/@spectrum-ts/terminal) |
| Custom | `definePlatform` from `spectrum-ts` |

Expand Down
23 changes: 22 additions & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

441 changes: 441 additions & 0 deletions docs/discord.md

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion packages/core/src/authoring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,21 @@ export {
setLogLevel,
} from "@photon-ai/otel";
// Content factories, schemas, and the inbound-record type (from `content/`).
export { asAttachment } from "./content/attachment";
export { asAttachment, attachmentSchema } from "./content/attachment";
export { asContact } from "./content/contact";
export { asCustom } from "./content/custom";
export { asEdit } from "./content/edit";
export { messageEffectSchema } from "./content/effect";
export { asGroup, groupSchema } from "./content/group";
export { asMarkdown } from "./content/markdown";
export { asPoll, asPollOption } from "./content/poll";
export { asReaction, reactionSchema } from "./content/reaction";
export { asRead } from "./content/read";
export { asReply } from "./content/reply";
export { asRichlink } from "./content/richlink";
export { asText } from "./content/text";
export type { BaseContent } from "./content/types";
export { asUnsend } from "./content/unsend";
export { asVoice } from "./content/voice";
export type { ProviderMessageRecord } from "./platform/types";
// Generic translation helpers (from `utils/`).
Expand All @@ -60,4 +64,5 @@ export {
type ResumableStreamItem,
resumableOrderedStream,
} from "./utils/resumable-stream";
export { createStore } from "./utils/store";
export { errorAttrs } from "./utils/telemetry";
7 changes: 5 additions & 2 deletions packages/core/src/platform/define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ export function definePlatform<
never,
never
>,
_Actions extends Record<string, InstanceActionFn> = Record<never, never>,
>(
name: _Name,
def: Omit<
Expand All @@ -454,7 +455,8 @@ export function definePlatform<
>,
_FusorEvents,
_SpaceActions,
_MessageActions
_MessageActions,
_Actions
>,
"lifecycle" | "name" | "messages"
> & {
Expand Down Expand Up @@ -490,7 +492,8 @@ export function definePlatform<
>,
_FusorEvents,
_SpaceActions,
_MessageActions
_MessageActions,
_Actions
>
> &
Readonly<_Static>;
Expand Down
22 changes: 22 additions & 0 deletions packages/discord/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# @spectrum-ts/discord

Discord provider for [spectrum-ts](https://github.com/photon-hq/spectrum-ts). Inbound is delivered through Fusor webhooks; outbound goes through the Discord REST API.

## Install

```sh
bun add spectrum-ts @spectrum-ts/discord
```

## Use

```ts
import { Spectrum } from "spectrum-ts";
import { discord } from "@spectrum-ts/discord";

const spectrum = Spectrum({
providers: [discord.config({ botToken: "..." })],
});
```

See [the Discord provider docs](https://github.com/photon-hq/spectrum-ts/blob/main/docs/discord.md) for the full configuration and feature reference.
60 changes: 60 additions & 0 deletions packages/discord/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "@spectrum-ts/discord",
"version": "5.0.0",
"description": "Discord provider for spectrum-ts.",
"repository": {
"type": "git",
"url": "git+https://github.com/photon-hq/spectrum-ts.git",
"directory": "packages/discord"
},
"homepage": "https://photon.codes/spectrum",
"bugs": {
"url": "https://github.com/photon-hq/spectrum-ts/issues"
},
"type": "module",
"sideEffects": false,
"files": [
"dist"
],
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./src/index.ts",
"default": "./dist/index.js"
}
},
"publishConfig": {
"access": "public",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"spectrum": {
"key": "discord",
"import": "discord",
"label": "discord"
},
"scripts": {
"build": "tsdown && node ../../scripts/smoke-import.mjs dist/index.js",
"dev": "tsdown --watch",
"test": "bun test",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@photon-ai/discord-ts": "^10.0.0",
"zod": "^4.2.1"
},
"peerDependencies": {
"@spectrum-ts/core": "^5.0.0",
"typescript": "^5 || ^6.0.0"
},
"devDependencies": {
"@spectrum-ts/core": "workspace:*",
"@types/bun": "latest",
"tsdown": "^0.22.2"
},
"license": "MIT"
}
Loading
Loading