@elizaos/plugin-discord 1.3.3 → 2.0.0-alpha.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/dist/index.d.ts +2 -5
- package/package.json +35 -22
- package/LICENSE +0 -21
- package/README.md +0 -116
- package/dist/index.js +0 -7433
- package/dist/index.js.map +0 -1
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/plugin-discord",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.1",
|
|
4
|
+
"description": "",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"main": "dist/index.js",
|
|
6
7
|
"module": "dist/index.js",
|
|
7
8
|
"types": "dist/index.d.ts",
|
|
9
|
+
"sideEffects": false,
|
|
8
10
|
"repository": {
|
|
9
11
|
"type": "git",
|
|
10
12
|
"url": "git+https://github.com/elizaos-plugins/plugin-discord.git"
|
|
@@ -12,20 +14,34 @@
|
|
|
12
14
|
"exports": {
|
|
13
15
|
"./package.json": "./package.json",
|
|
14
16
|
".": {
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"default": "./dist/index.js"
|
|
19
20
|
}
|
|
20
21
|
},
|
|
21
22
|
"files": [
|
|
22
23
|
"dist"
|
|
23
24
|
],
|
|
25
|
+
"keywords": [],
|
|
26
|
+
"author": "elizaOS",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "bun run build.ts",
|
|
30
|
+
"build:ts": "bun run build.ts",
|
|
31
|
+
"dev": "bun --hot build.ts",
|
|
32
|
+
"clean": "rm -rf dist .turbo node_modules",
|
|
33
|
+
"test": "vitest run",
|
|
34
|
+
"typecheck": "tsc --noEmit",
|
|
35
|
+
"lint": "bunx @biomejs/biome check --write --unsafe .",
|
|
36
|
+
"lint:check": "bunx @biomejs/biome check .",
|
|
37
|
+
"format": "bunx @biomejs/biome format --write .",
|
|
38
|
+
"format:check": "bunx @biomejs/biome format ."
|
|
39
|
+
},
|
|
24
40
|
"dependencies": {
|
|
25
41
|
"@discordjs/opus": "^0.10.0",
|
|
26
42
|
"@discordjs/rest": "2.4.3",
|
|
27
43
|
"@discordjs/voice": "0.18.0",
|
|
28
|
-
"@elizaos/core": "
|
|
44
|
+
"@elizaos/core": "workspace:*",
|
|
29
45
|
"discord.js": "14.18.0",
|
|
30
46
|
"fast-levenshtein": "^3.0.0",
|
|
31
47
|
"fluent-ffmpeg": "^2.1.3",
|
|
@@ -33,30 +49,21 @@
|
|
|
33
49
|
"libsodium-wrappers": "^0.7.13",
|
|
34
50
|
"opusscript": "^0.1.1",
|
|
35
51
|
"prism-media": "1.3.5",
|
|
36
|
-
"typescript": "^5.
|
|
37
|
-
"zod": "4.
|
|
52
|
+
"typescript": "^5.9.3",
|
|
53
|
+
"zod": "^4.3.5"
|
|
38
54
|
},
|
|
39
55
|
"devDependencies": {
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
},
|
|
44
|
-
"scripts": {
|
|
45
|
-
"build": "tsup",
|
|
46
|
-
"dev": "tsup --watch",
|
|
47
|
-
"test": "elizaos test",
|
|
48
|
-
"lint": "prettier --write ./src",
|
|
49
|
-
"clean": "rm -rf dist .turbo node_modules .turbo-tsconfig.json tsconfig.tsbuildinfo",
|
|
50
|
-
"format": "prettier --write ./src",
|
|
51
|
-
"format:check": "prettier --check ./src"
|
|
56
|
+
"@types/node": "^25.0.3",
|
|
57
|
+
"typescript": "^5.9.3",
|
|
58
|
+
"@biomejs/biome": "^2.3.11"
|
|
52
59
|
},
|
|
53
60
|
"peerDependencies": {
|
|
54
|
-
"whatwg-url": "7.1.0"
|
|
61
|
+
"whatwg-url": "7.1.0",
|
|
62
|
+
"@elizaos/core": "workspace:*"
|
|
55
63
|
},
|
|
56
64
|
"publishConfig": {
|
|
57
65
|
"access": "public"
|
|
58
66
|
},
|
|
59
|
-
"gitHead": "646c632924826e2b75c2304a75ee56959fe4a460",
|
|
60
67
|
"agentConfig": {
|
|
61
68
|
"pluginType": "elizaos:plugin:1.0.0",
|
|
62
69
|
"pluginParameters": {
|
|
@@ -107,6 +114,12 @@
|
|
|
107
114
|
"description": "If true, the bot will only respond when explicitly mentioned. Can be overridden by character settings.",
|
|
108
115
|
"required": false,
|
|
109
116
|
"sensitive": false
|
|
117
|
+
},
|
|
118
|
+
"DISCORD_LISTEN_CHANNEL_IDS": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"description": "Comma-separated list of Discord channel IDs where the bot will only listen (not respond).",
|
|
121
|
+
"required": false,
|
|
122
|
+
"sensitive": false
|
|
110
123
|
}
|
|
111
124
|
}
|
|
112
125
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Shaw Walters and elizaOS Contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/README.md
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
# @elizaos/plugin-discord
|
|
2
|
-
|
|
3
|
-
A Discord plugin implementation for ElizaOS, enabling rich integration with Discord servers for managing interactions, voice, and message handling.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- Handle server join events and manage initial configurations
|
|
8
|
-
- Voice event management via the voice manager
|
|
9
|
-
- Manage and process new messages with the message manager
|
|
10
|
-
- Slash command registration and interaction handling
|
|
11
|
-
- Support for Discord attachments and media files
|
|
12
|
-
- Voice channel join/leave functionality
|
|
13
|
-
- Conversation summarization
|
|
14
|
-
- Media transcription capabilities
|
|
15
|
-
- Channel state and voice state providers
|
|
16
|
-
- Channel restriction support (limit bot to specific channels)
|
|
17
|
-
- Robust permissions management for bot functionality
|
|
18
|
-
- Event-driven architecture with comprehensive event handling
|
|
19
|
-
|
|
20
|
-
## Installation
|
|
21
|
-
|
|
22
|
-
As this is a workspace package, it's installed as part of the ElizaOS monorepo:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
bun install
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Configuration
|
|
29
|
-
|
|
30
|
-
The plugin requires the following environment variables:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
# Discord API Credentials (Required)
|
|
34
|
-
DISCORD_APPLICATION_ID=your_application_id
|
|
35
|
-
DISCORD_API_TOKEN=your_api_token
|
|
36
|
-
|
|
37
|
-
# Optional Settings
|
|
38
|
-
# Comma-separated list of Discord channel IDs to restrict the bot to.
|
|
39
|
-
# If not set, the bot operates in all channels as usual.
|
|
40
|
-
CHANNEL_IDS=123456789012345678,987654321098765432
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Usage
|
|
44
|
-
|
|
45
|
-
```json
|
|
46
|
-
const character = {
|
|
47
|
-
"plugins": [
|
|
48
|
-
...otherPlugins,
|
|
49
|
-
"@elizaos/plugin-discord"
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### Available Actions
|
|
55
|
-
|
|
56
|
-
The plugin provides the following actions:
|
|
57
|
-
|
|
58
|
-
1. **chatWithAttachments** - Handle messages with Discord attachments
|
|
59
|
-
2. **downloadMedia** - Download media files from Discord messages
|
|
60
|
-
3. **joinVoice** - Join a voice channel
|
|
61
|
-
4. **leaveVoice** - Leave a voice channel
|
|
62
|
-
5. **summarize** - Summarize conversation history
|
|
63
|
-
6. **transcribeMedia** - Transcribe audio/video media to text
|
|
64
|
-
|
|
65
|
-
### Providers
|
|
66
|
-
|
|
67
|
-
The plugin includes two state providers:
|
|
68
|
-
|
|
69
|
-
1. **channelStateProvider** - Provides state information about Discord channels
|
|
70
|
-
2. **voiceStateProvider** - Provides state information about voice channels
|
|
71
|
-
|
|
72
|
-
### Event Types
|
|
73
|
-
|
|
74
|
-
The plugin emits the following Discord-specific events:
|
|
75
|
-
|
|
76
|
-
- `GUILD_MEMBER_ADD` - When a new member joins a guild
|
|
77
|
-
- `GUILD_CREATE` - When the bot joins a guild
|
|
78
|
-
- `MESSAGE_CREATE` - When a message is created
|
|
79
|
-
- `INTERACTION_CREATE` - When an interaction is created
|
|
80
|
-
- `REACTION_RECEIVED` - When a reaction is added to a message
|
|
81
|
-
|
|
82
|
-
## Key Components
|
|
83
|
-
|
|
84
|
-
1. **DiscordService**
|
|
85
|
-
- Main service class that extends ElizaOS Service
|
|
86
|
-
- Handles authentication and session management
|
|
87
|
-
- Manages Discord client connection
|
|
88
|
-
- Processes events and interactions
|
|
89
|
-
|
|
90
|
-
2. **MessageManager**
|
|
91
|
-
- Processes incoming messages and responses
|
|
92
|
-
- Handles attachments and media files
|
|
93
|
-
- Supports message formatting and templating
|
|
94
|
-
- Manages conversation context
|
|
95
|
-
|
|
96
|
-
3. **VoiceManager**
|
|
97
|
-
- Manages voice channel interactions
|
|
98
|
-
- Handles joining and leaving voice channels
|
|
99
|
-
- Processes voice events and audio streams
|
|
100
|
-
- Integrates with transcription services
|
|
101
|
-
|
|
102
|
-
4. **Attachment Handler**
|
|
103
|
-
- Downloads and processes Discord attachments
|
|
104
|
-
- Supports various media types
|
|
105
|
-
- Integrates with media transcription
|
|
106
|
-
|
|
107
|
-
## Testing
|
|
108
|
-
|
|
109
|
-
The plugin includes a test suite (`DiscordTestSuite`) for validating functionality.
|
|
110
|
-
|
|
111
|
-
## Notes
|
|
112
|
-
|
|
113
|
-
- Ensure that your `.env` file includes the required `DISCORD_API_TOKEN` for proper functionality
|
|
114
|
-
- The bot requires appropriate Discord permissions to function correctly (send messages, connect to voice channels, etc.)
|
|
115
|
-
- If no token is provided, the plugin will load but remain non-functional with appropriate warnings
|
|
116
|
-
- The plugin uses Discord.js v14.18.0 with comprehensive intent support
|