discord-flow 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# discord-flow
|
|
2
|
+
|
|
3
|
+
State-driven framework for Discord bots using HTTP Interactions API.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🚀 **HTTP-only** - No WebSocket Gateway, just HTTP interactions
|
|
8
|
+
- 🎯 **State Machine** - Define flows as state machines
|
|
9
|
+
- 📦 **~30MB RAM** - Minimal memory footprint
|
|
10
|
+
- 🔧 **TypeScript** - Fully typed
|
|
11
|
+
- ⚡ **Fast** - Optimized for serverless environments
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install discord-flow
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { registry, createServer } from 'discord-flow';
|
|
23
|
+
|
|
24
|
+
const engine = registry.create();
|
|
25
|
+
|
|
26
|
+
registry.define('bot', (flow) => {
|
|
27
|
+
flow.start('idle');
|
|
28
|
+
|
|
29
|
+
flow.state('idle')
|
|
30
|
+
.on.command({
|
|
31
|
+
name: 'ping',
|
|
32
|
+
description: 'Pong!'
|
|
33
|
+
}, () => ({
|
|
34
|
+
response: { content: 'Pong! 🏓' }
|
|
35
|
+
}));
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
createServer({
|
|
39
|
+
publicKey: process.env.DISCORD_PUBLIC_KEY!,
|
|
40
|
+
token: process.env.DISCORD_TOKEN!,
|
|
41
|
+
engine
|
|
42
|
+
}).start();
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Documentation
|
|
46
|
+
|
|
47
|
+
Visit [discord-flow.dev](https://discord-flow.dev) for full documentation.
|
|
48
|
+
|
|
49
|
+
## Packages
|
|
50
|
+
|
|
51
|
+
This is a monorepo containing:
|
|
52
|
+
|
|
53
|
+
- `discord-flow` - Main package (this one)
|
|
54
|
+
- `@discord-flow/core` - Core flow engine
|
|
55
|
+
- `@discord-flow/types` - TypeScript types
|
|
56
|
+
- `@discord-flow/store` - State store
|
|
57
|
+
- `@discord-flow/adapter-discord-http` - HTTP adapter
|
|
58
|
+
- `@discord-flow/multibots` - Multi-bot server support
|
|
59
|
+
|
|
60
|
+
## License
|
|
61
|
+
|
|
62
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "discord-flow",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "State-driven framework for Discord bots using HTTP Interactions API",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"type": "git",
|
|
41
41
|
"url": "https://github.com/discord-flow/discord-flow.git"
|
|
42
42
|
},
|
|
43
|
-
"homepage": "https://
|
|
43
|
+
"homepage": "https://flow.loopbot.app",
|
|
44
44
|
"bugs": {
|
|
45
45
|
"url": "https://github.com/discord-flow/discord-flow/issues"
|
|
46
46
|
}
|