agent-messenger 1.3.0 → 1.3.2
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/.claude-plugin/marketplace.json +27 -1
- package/.claude-plugin/plugin.json +17 -4
- package/.env.template +3 -0
- package/.github/workflows/release.yml +80 -0
- package/AGENTS.md +48 -0
- package/README.md +25 -20
- package/biome.json +15 -39
- package/bun.lock +69 -0
- package/dist/package.json +10 -3
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +1 -4
- package/dist/src/cli.js.map +1 -1
- package/dist/src/platforms/discord/client.d.ts.map +1 -1
- package/dist/src/platforms/discord/client.js.map +1 -1
- package/dist/src/platforms/discord/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/auth.js.map +1 -1
- package/dist/src/platforms/discord/commands/channel.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/channel.js.map +1 -1
- package/dist/src/platforms/discord/commands/dm.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/dm.js.map +1 -1
- package/dist/src/platforms/discord/commands/file.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/file.js +1 -4
- package/dist/src/platforms/discord/commands/file.js.map +1 -1
- package/dist/src/platforms/discord/commands/friend.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/friend.js +1 -3
- package/dist/src/platforms/discord/commands/friend.js.map +1 -1
- package/dist/src/platforms/discord/commands/member.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/member.js.map +1 -1
- package/dist/src/platforms/discord/commands/mention.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/mention.js.map +1 -1
- package/dist/src/platforms/discord/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/message.js.map +1 -1
- package/dist/src/platforms/discord/commands/note.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/note.js.map +1 -1
- package/dist/src/platforms/discord/commands/profile.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/profile.js.map +1 -1
- package/dist/src/platforms/discord/commands/reaction.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/reaction.js.map +1 -1
- package/dist/src/platforms/discord/commands/server.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/server.js.map +1 -1
- package/dist/src/platforms/discord/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/discord/commands/thread.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/thread.js.map +1 -1
- package/dist/src/platforms/discord/commands/user.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/user.js.map +1 -1
- package/dist/src/platforms/discord/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/discord/credential-manager.js.map +1 -1
- package/dist/src/platforms/discord/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/discord/token-extractor.js +2 -7
- package/dist/src/platforms/discord/token-extractor.js.map +1 -1
- package/dist/src/platforms/slack/client.d.ts.map +1 -1
- package/dist/src/platforms/slack/client.js +2 -0
- package/dist/src/platforms/slack/client.js.map +1 -1
- package/dist/src/platforms/slack/commands/activity.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/activity.js.map +1 -1
- package/dist/src/platforms/slack/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/auth.js.map +1 -1
- package/dist/src/platforms/slack/commands/channel.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/channel.js.map +1 -1
- package/dist/src/platforms/slack/commands/drafts.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/drafts.js.map +1 -1
- package/dist/src/platforms/slack/commands/file.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/file.js +1 -4
- package/dist/src/platforms/slack/commands/file.js.map +1 -1
- package/dist/src/platforms/slack/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/message.js.map +1 -1
- package/dist/src/platforms/slack/commands/reaction.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/reaction.js +1 -2
- package/dist/src/platforms/slack/commands/reaction.js.map +1 -1
- package/dist/src/platforms/slack/commands/saved.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/saved.js.map +1 -1
- package/dist/src/platforms/slack/commands/sections.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/sections.js.map +1 -1
- package/dist/src/platforms/slack/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/slack/commands/unread.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/unread.js.map +1 -1
- package/dist/src/platforms/slack/commands/user.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/user.js.map +1 -1
- package/dist/src/platforms/slack/commands/workspace.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/workspace.js.map +1 -1
- package/dist/src/platforms/slack/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/slack/token-extractor.js +4 -5
- package/dist/src/platforms/slack/token-extractor.js.map +1 -1
- package/dist/src/platforms/slack/types.d.ts +24 -0
- package/dist/src/platforms/slack/types.d.ts.map +1 -1
- package/dist/src/platforms/slack/types.js +7 -0
- package/dist/src/platforms/slack/types.js.map +1 -1
- package/dist/src/platforms/slackbot/cli.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/cli.js +1 -1
- package/dist/src/platforms/slackbot/cli.js.map +1 -1
- package/dist/src/platforms/slackbot/client.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/client.js.map +1 -1
- package/dist/src/platforms/slackbot/commands/auth.js.map +1 -1
- package/dist/src/platforms/slackbot/commands/channel.js.map +1 -1
- package/dist/src/platforms/slackbot/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/commands/message.js.map +1 -1
- package/dist/src/platforms/slackbot/commands/reaction.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/commands/reaction.js.map +1 -1
- package/dist/src/platforms/slackbot/commands/shared.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/commands/shared.js.map +1 -1
- package/dist/src/platforms/slackbot/commands/user.js.map +1 -1
- package/dist/src/platforms/slackbot/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/credential-manager.js +2 -4
- package/dist/src/platforms/slackbot/credential-manager.js.map +1 -1
- package/dist/src/platforms/teams/client.d.ts.map +1 -1
- package/dist/src/platforms/teams/client.js.map +1 -1
- package/dist/src/platforms/teams/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/auth.js.map +1 -1
- package/dist/src/platforms/teams/commands/channel.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/channel.js.map +1 -1
- package/dist/src/platforms/teams/commands/file.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/file.js.map +1 -1
- package/dist/src/platforms/teams/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/message.js.map +1 -1
- package/dist/src/platforms/teams/commands/reaction.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/reaction.js.map +1 -1
- package/dist/src/platforms/teams/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/teams/commands/team.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/team.js +1 -4
- package/dist/src/platforms/teams/commands/team.js.map +1 -1
- package/dist/src/platforms/teams/commands/user.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/user.js.map +1 -1
- package/dist/src/platforms/teams/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/teams/token-extractor.js +3 -1
- package/dist/src/platforms/teams/token-extractor.js.map +1 -1
- package/docs/content/docs/agent-skills.mdx +4 -4
- package/docs/content/docs/index.mdx +11 -18
- package/docs/content/docs/integrations/discord.mdx +65 -1
- package/docs/content/docs/integrations/slack.mdx +51 -1
- package/docs/content/docs/integrations/slackbot.mdx +11 -1
- package/docs/content/docs/integrations/teams.mdx +4 -1
- package/docs/content/docs/quick-start.mdx +3 -2
- package/docs/src/app/icon.png +0 -0
- package/docs/src/app/layout.config.tsx +8 -1
- package/package.json +16 -9
- package/scripts/prepublish.ts +11 -0
- package/skills/agent-discord/SKILL.md +14 -0
- package/skills/agent-slack/SKILL.md +14 -0
- package/skills/agent-slackbot/SKILL.md +14 -0
- package/skills/agent-teams/SKILL.md +14 -0
- package/src/cli.ts +1 -4
- package/src/platforms/discord/client.test.ts +6 -14
- package/src/platforms/discord/client.ts +12 -34
- package/src/platforms/discord/commands/auth.test.ts +2 -7
- package/src/platforms/discord/commands/auth.ts +14 -19
- package/src/platforms/discord/commands/channel.test.ts +18 -20
- package/src/platforms/discord/commands/channel.ts +9 -18
- package/src/platforms/discord/commands/dm.test.ts +1 -3
- package/src/platforms/discord/commands/dm.ts +6 -10
- package/src/platforms/discord/commands/file.ts +10 -23
- package/src/platforms/discord/commands/friend.ts +33 -35
- package/src/platforms/discord/commands/member.ts +5 -7
- package/src/platforms/discord/commands/mention.ts +5 -11
- package/src/platforms/discord/commands/message.test.ts +1 -3
- package/src/platforms/discord/commands/message.ts +23 -61
- package/src/platforms/discord/commands/note.ts +7 -15
- package/src/platforms/discord/commands/profile.ts +4 -6
- package/src/platforms/discord/commands/reaction.test.ts +1 -3
- package/src/platforms/discord/commands/reaction.ts +19 -29
- package/src/platforms/discord/commands/server.test.ts +14 -18
- package/src/platforms/discord/commands/server.ts +9 -15
- package/src/platforms/discord/commands/snapshot.ts +5 -7
- package/src/platforms/discord/commands/thread.ts +8 -15
- package/src/platforms/discord/commands/user.ts +9 -20
- package/src/platforms/discord/credential-manager.test.ts +2 -2
- package/src/platforms/discord/credential-manager.ts +1 -3
- package/src/platforms/discord/token-extractor.test.ts +28 -57
- package/src/platforms/discord/token-extractor.ts +10 -30
- package/src/platforms/discord/types.ts +1 -1
- package/src/platforms/slack/client.test.ts +14 -20
- package/src/platforms/slack/client.ts +6 -11
- package/src/platforms/slack/commands/activity.test.ts +3 -9
- package/src/platforms/slack/commands/activity.ts +7 -12
- package/src/platforms/slack/commands/auth.test.ts +2 -2
- package/src/platforms/slack/commands/auth.ts +15 -31
- package/src/platforms/slack/commands/channel.ts +10 -32
- package/src/platforms/slack/commands/drafts.ts +5 -14
- package/src/platforms/slack/commands/file.ts +9 -29
- package/src/platforms/slack/commands/message.ts +23 -67
- package/src/platforms/slack/commands/reaction.test.ts +37 -33
- package/src/platforms/slack/commands/reaction.ts +21 -51
- package/src/platforms/slack/commands/saved.ts +5 -14
- package/src/platforms/slack/commands/sections.ts +4 -11
- package/src/platforms/slack/commands/snapshot.test.ts +1 -3
- package/src/platforms/slack/commands/snapshot.ts +5 -10
- package/src/platforms/slack/commands/unread.test.ts +6 -8
- package/src/platforms/slack/commands/unread.ts +10 -33
- package/src/platforms/slack/commands/user.test.ts +1 -4
- package/src/platforms/slack/commands/user.ts +6 -8
- package/src/platforms/slack/commands/workspace.test.ts +1 -1
- package/src/platforms/slack/commands/workspace.ts +7 -12
- package/src/platforms/slack/token-extractor-node-test.ts +1 -1
- package/src/platforms/slack/token-extractor.ts +8 -17
- package/src/platforms/slack/types.ts +11 -1
- package/src/platforms/slackbot/cli.ts +1 -7
- package/src/platforms/slackbot/client.test.ts +7 -7
- package/src/platforms/slackbot/client.ts +4 -11
- package/src/platforms/slackbot/commands/auth.test.ts +1 -1
- package/src/platforms/slackbot/commands/auth.ts +7 -7
- package/src/platforms/slackbot/commands/channel.ts +4 -4
- package/src/platforms/slackbot/commands/message.ts +16 -29
- package/src/platforms/slackbot/commands/reaction.ts +6 -16
- package/src/platforms/slackbot/commands/shared.ts +2 -4
- package/src/platforms/slackbot/commands/user.ts +4 -4
- package/src/platforms/slackbot/credential-manager.ts +2 -7
- package/src/platforms/slackbot/types.ts +1 -1
- package/src/platforms/teams/client.test.ts +15 -32
- package/src/platforms/teams/client.ts +18 -51
- package/src/platforms/teams/commands/auth.test.ts +6 -16
- package/src/platforms/teams/commands/auth.ts +16 -26
- package/src/platforms/teams/commands/channel.test.ts +2 -5
- package/src/platforms/teams/commands/channel.ts +10 -20
- package/src/platforms/teams/commands/file.test.ts +1 -4
- package/src/platforms/teams/commands/file.ts +11 -21
- package/src/platforms/teams/commands/message.test.ts +1 -3
- package/src/platforms/teams/commands/message.ts +15 -25
- package/src/platforms/teams/commands/reaction.test.ts +2 -7
- package/src/platforms/teams/commands/reaction.ts +12 -16
- package/src/platforms/teams/commands/snapshot.ts +6 -11
- package/src/platforms/teams/commands/team.test.ts +15 -26
- package/src/platforms/teams/commands/team.ts +10 -19
- package/src/platforms/teams/commands/user.ts +8 -14
- package/src/platforms/teams/credential-manager.test.ts +2 -5
- package/src/platforms/teams/token-extractor.test.ts +21 -50
- package/src/platforms/teams/token-extractor.ts +12 -20
- package/src/platforms/teams/types.ts +1 -1
- package/src/shared/utils/concurrency.test.ts +2 -2
- package/src/shared/utils/concurrency.ts +1 -1
- package/.claude/commands/release.md +0 -92
- package/dist/src/platforms/discord/commands/guild.d.ts +0 -15
- package/dist/src/platforms/discord/commands/guild.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/guild.js +0 -102
- package/dist/src/platforms/discord/commands/guild.js.map +0 -1
|
@@ -154,8 +154,58 @@ agent-slack snapshot --users-only
|
|
|
154
154
|
agent-slack snapshot --limit 10
|
|
155
155
|
```
|
|
156
156
|
|
|
157
|
+
### Activity Commands
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# List activity feed
|
|
161
|
+
agent-slack activity list
|
|
162
|
+
agent-slack activity list --limit 50
|
|
163
|
+
|
|
164
|
+
# Show only unread activity
|
|
165
|
+
agent-slack activity list --unread
|
|
166
|
+
|
|
167
|
+
# Filter by activity types
|
|
168
|
+
agent-slack activity list --types thread_reply,message_reaction,at_user,at_channel,keyword
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Unread Commands
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
# Get unread counts for all channels
|
|
175
|
+
agent-slack unread counts
|
|
176
|
+
|
|
177
|
+
# Get thread subscription details
|
|
178
|
+
agent-slack unread threads <channel> <thread_ts>
|
|
179
|
+
|
|
180
|
+
# Mark channel as read up to a timestamp
|
|
181
|
+
agent-slack unread mark <channel> <ts>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Drafts Commands
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# List message drafts
|
|
188
|
+
agent-slack drafts list
|
|
189
|
+
agent-slack drafts list --limit 10
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Saved Items Commands
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# List saved items
|
|
196
|
+
agent-slack saved list
|
|
197
|
+
agent-slack saved list --limit 10
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Sections Commands
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
# List channel sections (sidebar folders)
|
|
204
|
+
agent-slack sections list
|
|
205
|
+
```
|
|
206
|
+
|
|
157
207
|
## AI Agent Integration
|
|
158
208
|
|
|
159
|
-
See `skills/agent-messenger
|
|
209
|
+
See [`skills/agent-slack/`](https://github.com/devxoul/agent-messenger/tree/main/skills/agent-slack) for:
|
|
160
210
|
- Complete skill documentation
|
|
161
211
|
- Runnable templates
|
|
@@ -74,6 +74,16 @@ agent-slackbot auth set xoxb-your-bot-token --bot deploy --name "Deploy Bot"
|
|
|
74
74
|
agent-slackbot auth status
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
+
### Authentication Commands
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Check bot auth status
|
|
81
|
+
agent-slackbot auth status
|
|
82
|
+
|
|
83
|
+
# Clear all stored credentials
|
|
84
|
+
agent-slackbot auth clear
|
|
85
|
+
```
|
|
86
|
+
|
|
77
87
|
### Multi-Bot Support
|
|
78
88
|
|
|
79
89
|
Store multiple bot tokens and switch between them:
|
|
@@ -198,7 +208,7 @@ agent-slackbot reaction remove <channel> <ts> <emoji>
|
|
|
198
208
|
|
|
199
209
|
## AI Agent Integration
|
|
200
210
|
|
|
201
|
-
See `skills/agent-slackbot/`
|
|
211
|
+
See [`skills/agent-slackbot/`](https://github.com/devxoul/agent-messenger/tree/main/skills/agent-slackbot) for:
|
|
202
212
|
- Complete skill documentation
|
|
203
213
|
- Runnable templates
|
|
204
214
|
- Common patterns for AI agents
|
|
@@ -109,6 +109,9 @@ agent-teams team current
|
|
|
109
109
|
|
|
110
110
|
# Get team info
|
|
111
111
|
agent-teams team info <team-id>
|
|
112
|
+
|
|
113
|
+
# Remove a stored team
|
|
114
|
+
agent-teams team remove <team-id>
|
|
112
115
|
```
|
|
113
116
|
|
|
114
117
|
## Commands
|
|
@@ -283,7 +286,7 @@ Some operations require specific Microsoft 365 permissions. Check with your IT a
|
|
|
283
286
|
|
|
284
287
|
## AI Agent Integration
|
|
285
288
|
|
|
286
|
-
See `skills/agent-messenger
|
|
289
|
+
See [`skills/agent-teams/`](https://github.com/devxoul/agent-messenger/tree/main/skills/agent-teams) for:
|
|
287
290
|
- Complete skill documentation
|
|
288
291
|
- Runnable templates
|
|
289
292
|
|
|
@@ -23,8 +23,9 @@ yarn global add agent-messenger
|
|
|
23
23
|
bun add -g agent-messenger
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
This installs
|
|
27
|
-
- `agent-slack` — Slack CLI
|
|
26
|
+
This installs four CLI tools:
|
|
27
|
+
- `agent-slack` — Slack CLI (user token, zero-config)
|
|
28
|
+
- `agent-slackbot` — Slack Bot CLI (bot token, for server-side/CI/CD)
|
|
28
29
|
- `agent-discord` — Discord CLI
|
|
29
30
|
- `agent-teams` — Microsoft Teams CLI
|
|
30
31
|
|
package/docs/src/app/icon.png
CHANGED
|
Binary file
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared'
|
|
2
|
+
import Image from 'next/image'
|
|
3
|
+
import icon from './icon.png'
|
|
2
4
|
|
|
3
5
|
export const baseOptions: BaseLayoutProps = {
|
|
4
6
|
nav: {
|
|
5
|
-
title:
|
|
7
|
+
title: (
|
|
8
|
+
<>
|
|
9
|
+
<Image src={icon} alt="Agent Messenger" width={24} height={24} />
|
|
10
|
+
Agent Messenger
|
|
11
|
+
</>
|
|
12
|
+
),
|
|
6
13
|
},
|
|
7
14
|
}
|
package/package.json
CHANGED
|
@@ -1,28 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-messenger",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Multi-platform messaging CLI for AI agents (Slack, Discord, Teams)",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/devxoul/agent-messenger"
|
|
8
|
+
},
|
|
5
9
|
"type": "module",
|
|
6
10
|
"module": "dist/cli.js",
|
|
7
11
|
"main": "dist/cli.js",
|
|
8
12
|
"bin": {
|
|
9
|
-
"agent-messenger": "
|
|
10
|
-
"amsg": "
|
|
11
|
-
"agent-slack": "
|
|
12
|
-
"agent-discord": "
|
|
13
|
-
"agent-teams": "
|
|
14
|
-
"agent-slackbot": "
|
|
13
|
+
"agent-messenger": "dist/src/cli.js",
|
|
14
|
+
"amsg": "dist/src/cli.js",
|
|
15
|
+
"agent-slack": "dist/src/platforms/slack/cli.js",
|
|
16
|
+
"agent-discord": "dist/src/platforms/discord/cli.js",
|
|
17
|
+
"agent-teams": "dist/src/platforms/teams/cli.js",
|
|
18
|
+
"agent-slackbot": "dist/src/platforms/slackbot/cli.js"
|
|
15
19
|
},
|
|
16
20
|
"scripts": {
|
|
17
|
-
"build": "tsc",
|
|
21
|
+
"build": "tsc && tsc-alias",
|
|
18
22
|
"postbuild": "bun scripts/postbuild.ts",
|
|
19
23
|
"test": "bun test src/",
|
|
20
24
|
"test:e2e": "bun test e2e/",
|
|
21
25
|
"typecheck": "tsc --noEmit",
|
|
22
26
|
"lint": "biome check .",
|
|
27
|
+
"lint:fix": "biome check --write --unsafe .",
|
|
23
28
|
"format": "biome format --write .",
|
|
24
29
|
"dev": "bun --hot ./dist/cli.js",
|
|
25
|
-
"prepublishOnly": "bun run build"
|
|
30
|
+
"prepublishOnly": "bun run build && bun scripts/prepublish.ts",
|
|
31
|
+
"postpublish": "git checkout package.json"
|
|
26
32
|
},
|
|
27
33
|
"dependencies": {
|
|
28
34
|
"@slack/web-api": "^6.9.0",
|
|
@@ -36,6 +42,7 @@
|
|
|
36
42
|
"@types/better-sqlite3": "^7.6.8",
|
|
37
43
|
"@types/bun": "latest",
|
|
38
44
|
"@types/node": "^20.10.6",
|
|
45
|
+
"tsc-alias": "^1.8.16",
|
|
39
46
|
"tsx": "^4.21.0",
|
|
40
47
|
"typescript": "^5.9.3"
|
|
41
48
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync } from 'node:fs'
|
|
2
|
+
|
|
3
|
+
const pkgPath = 'package.json'
|
|
4
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'))
|
|
5
|
+
|
|
6
|
+
for (const [name, path] of Object.entries(pkg.bin as Record<string, string>)) {
|
|
7
|
+
pkg.bin[name] = path.replace(/^\.\/src\//, 'dist/src/').replace(/\.ts$/, '.js')
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`)
|
|
11
|
+
console.log('Rewrote bin paths for publish')
|
|
@@ -333,6 +333,20 @@ Format:
|
|
|
333
333
|
- Plain text messages only (no embeds in v1)
|
|
334
334
|
- User tokens only (no bot tokens)
|
|
335
335
|
|
|
336
|
+
## Troubleshooting
|
|
337
|
+
|
|
338
|
+
### `agent-discord: command not found`
|
|
339
|
+
|
|
340
|
+
The `agent-messenger` package is not installed. Run it directly using a package runner. Ask the user which one to use:
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
npx -p agent-messenger agent-discord ...
|
|
344
|
+
bunx -p agent-messenger agent-discord ...
|
|
345
|
+
pnpm dlx --package agent-messenger agent-discord ...
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
If you already know the user's preferred package runner, use it directly instead of asking.
|
|
349
|
+
|
|
336
350
|
## References
|
|
337
351
|
|
|
338
352
|
- [Authentication Guide](references/authentication.md)
|
|
@@ -315,6 +315,20 @@ Format:
|
|
|
315
315
|
- No user presence features
|
|
316
316
|
- Plain text messages only (no blocks/formatting in v1)
|
|
317
317
|
|
|
318
|
+
## Troubleshooting
|
|
319
|
+
|
|
320
|
+
### `agent-slack: command not found`
|
|
321
|
+
|
|
322
|
+
The `agent-messenger` package is not installed. Run it directly using a package runner. Ask the user which one to use:
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
npx -p agent-messenger agent-slack ...
|
|
326
|
+
bunx -p agent-messenger agent-slack ...
|
|
327
|
+
pnpm dlx --package agent-messenger agent-slack ...
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
If you already know the user's preferred package runner, use it directly instead of asking.
|
|
331
|
+
|
|
318
332
|
## References
|
|
319
333
|
|
|
320
334
|
- [Authentication Guide](references/authentication.md)
|
|
@@ -279,6 +279,20 @@ Format:
|
|
|
279
279
|
- No scheduled messages
|
|
280
280
|
- Plain text messages only (no blocks/formatting)
|
|
281
281
|
|
|
282
|
+
## Troubleshooting
|
|
283
|
+
|
|
284
|
+
### `agent-slackbot: command not found`
|
|
285
|
+
|
|
286
|
+
The `agent-messenger` package is not installed. Run it directly using a package runner. Ask the user which one to use:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
npx -p agent-messenger agent-slackbot ...
|
|
290
|
+
bunx -p agent-messenger agent-slackbot ...
|
|
291
|
+
pnpm dlx --package agent-messenger agent-slackbot ...
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
If you already know the user's preferred package runner, use it directly instead of asking.
|
|
295
|
+
|
|
282
296
|
## References
|
|
283
297
|
|
|
284
298
|
- [Authentication Guide](references/authentication.md)
|
|
@@ -286,6 +286,20 @@ Format:
|
|
|
286
286
|
- User tokens only (no app tokens)
|
|
287
287
|
- **Token expires in 60-90 minutes** - must re-authenticate frequently
|
|
288
288
|
|
|
289
|
+
## Troubleshooting
|
|
290
|
+
|
|
291
|
+
### `agent-teams: command not found`
|
|
292
|
+
|
|
293
|
+
The `agent-messenger` package is not installed. Run it directly using a package runner. Ask the user which one to use:
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
npx -p agent-messenger agent-teams ...
|
|
297
|
+
bunx -p agent-messenger agent-teams ...
|
|
298
|
+
pnpm dlx --package agent-messenger agent-teams ...
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
If you already know the user's preferred package runner, use it directly instead of asking.
|
|
302
|
+
|
|
289
303
|
## References
|
|
290
304
|
|
|
291
305
|
- [Authentication Guide](references/authentication.md)
|
package/src/cli.ts
CHANGED
|
@@ -10,10 +10,7 @@ const __dirname = dirname(__filename)
|
|
|
10
10
|
|
|
11
11
|
const program = new Command()
|
|
12
12
|
|
|
13
|
-
program
|
|
14
|
-
.name('agent-messenger')
|
|
15
|
-
.description('Multi-platform messaging CLI for AI agents')
|
|
16
|
-
.version(pkg.version)
|
|
13
|
+
program.name('agent-messenger').description('Multi-platform messaging CLI for AI agents').version(pkg.version)
|
|
17
14
|
|
|
18
15
|
// Use absolute paths for CWD-independence
|
|
19
16
|
program.command('slack', 'Interact with Slack workspaces', {
|
|
@@ -11,10 +11,7 @@ describe('DiscordClient', () => {
|
|
|
11
11
|
fetchCalls = []
|
|
12
12
|
fetchResponses = []
|
|
13
13
|
fetchIndex = 0
|
|
14
|
-
;(globalThis as any).fetch = async (
|
|
15
|
-
url: string | URL | Request,
|
|
16
|
-
options?: RequestInit
|
|
17
|
-
): Promise<Response> => {
|
|
14
|
+
;(globalThis as any).fetch = async (url: string | URL | Request, options?: RequestInit): Promise<Response> => {
|
|
18
15
|
fetchCalls.push({ url: url.toString(), options })
|
|
19
16
|
const response = fetchResponses[fetchIndex]
|
|
20
17
|
fetchIndex++
|
|
@@ -45,7 +42,7 @@ describe('DiscordClient', () => {
|
|
|
45
42
|
new Response(body === null ? null : JSON.stringify(body), {
|
|
46
43
|
status,
|
|
47
44
|
headers: defaultHeaders,
|
|
48
|
-
})
|
|
45
|
+
}),
|
|
49
46
|
)
|
|
50
47
|
}
|
|
51
48
|
|
|
@@ -236,7 +233,7 @@ describe('DiscordClient', () => {
|
|
|
236
233
|
await client.addReaction('ch1', 'msg1', '👍')
|
|
237
234
|
|
|
238
235
|
expect(fetchCalls[0].url).toBe(
|
|
239
|
-
'https://discord.com/api/v10/channels/ch1/messages/msg1/reactions/%F0%9F%91%8D/@me'
|
|
236
|
+
'https://discord.com/api/v10/channels/ch1/messages/msg1/reactions/%F0%9F%91%8D/@me',
|
|
240
237
|
)
|
|
241
238
|
expect(fetchCalls[0].options?.method).toBe('PUT')
|
|
242
239
|
})
|
|
@@ -250,7 +247,7 @@ describe('DiscordClient', () => {
|
|
|
250
247
|
await client.removeReaction('ch1', 'msg1', '👍')
|
|
251
248
|
|
|
252
249
|
expect(fetchCalls[0].url).toBe(
|
|
253
|
-
'https://discord.com/api/v10/channels/ch1/messages/msg1/reactions/%F0%9F%91%8D/@me'
|
|
250
|
+
'https://discord.com/api/v10/channels/ch1/messages/msg1/reactions/%F0%9F%91%8D/@me',
|
|
254
251
|
)
|
|
255
252
|
expect(fetchCalls[0].options?.method).toBe('DELETE')
|
|
256
253
|
})
|
|
@@ -258,10 +255,7 @@ describe('DiscordClient', () => {
|
|
|
258
255
|
|
|
259
256
|
describe('listUsers', () => {
|
|
260
257
|
test('returns list of server members', async () => {
|
|
261
|
-
mockResponse([
|
|
262
|
-
{ user: { id: 'u1', username: 'user1' } },
|
|
263
|
-
{ user: { id: 'u2', username: 'user2' } },
|
|
264
|
-
])
|
|
258
|
+
mockResponse([{ user: { id: 'u1', username: 'user1' } }, { user: { id: 'u2', username: 'user2' } }])
|
|
265
259
|
|
|
266
260
|
const client = new DiscordClient('test-token')
|
|
267
261
|
const users = await client.listUsers('111')
|
|
@@ -324,9 +318,7 @@ describe('DiscordClient', () => {
|
|
|
324
318
|
author: { id: '123', username: 'user1' },
|
|
325
319
|
content: '',
|
|
326
320
|
timestamp: '2024-01-01T00:00:00.000Z',
|
|
327
|
-
attachments: [
|
|
328
|
-
{ id: 'att1', filename: 'file1.txt', size: 100, url: 'https://example.com/file1.txt' },
|
|
329
|
-
],
|
|
321
|
+
attachments: [{ id: 'att1', filename: 'file1.txt', size: 100, url: 'https://example.com/file1.txt' }],
|
|
330
322
|
},
|
|
331
323
|
{
|
|
332
324
|
id: 'msg2',
|
|
@@ -143,7 +143,7 @@ export class DiscordClient {
|
|
|
143
143
|
const errorBody = await response.json().catch(() => ({}))
|
|
144
144
|
throw new DiscordError(
|
|
145
145
|
(errorBody as any).message || `HTTP ${response.status}`,
|
|
146
|
-
(errorBody as any).code?.toString() || `http_${response.status}
|
|
146
|
+
(errorBody as any).code?.toString() || `http_${response.status}`,
|
|
147
147
|
)
|
|
148
148
|
}
|
|
149
149
|
|
|
@@ -176,7 +176,7 @@ export class DiscordClient {
|
|
|
176
176
|
const errorBody = await response.json().catch(() => ({}))
|
|
177
177
|
throw new DiscordError(
|
|
178
178
|
(errorBody as any).message || `HTTP ${response.status}`,
|
|
179
|
-
(errorBody as any).code?.toString() || `http_${response.status}
|
|
179
|
+
(errorBody as any).code?.toString() || `http_${response.status}`,
|
|
180
180
|
)
|
|
181
181
|
}
|
|
182
182
|
|
|
@@ -221,18 +221,12 @@ export class DiscordClient {
|
|
|
221
221
|
|
|
222
222
|
async addReaction(channelId: string, messageId: string, emoji: string): Promise<void> {
|
|
223
223
|
const encodedEmoji = encodeURIComponent(emoji)
|
|
224
|
-
return this.request<void>(
|
|
225
|
-
'PUT',
|
|
226
|
-
`/channels/${channelId}/messages/${messageId}/reactions/${encodedEmoji}/@me`
|
|
227
|
-
)
|
|
224
|
+
return this.request<void>('PUT', `/channels/${channelId}/messages/${messageId}/reactions/${encodedEmoji}/@me`)
|
|
228
225
|
}
|
|
229
226
|
|
|
230
227
|
async removeReaction(channelId: string, messageId: string, emoji: string): Promise<void> {
|
|
231
228
|
const encodedEmoji = encodeURIComponent(emoji)
|
|
232
|
-
return this.request<void>(
|
|
233
|
-
'DELETE',
|
|
234
|
-
`/channels/${channelId}/messages/${messageId}/reactions/${encodedEmoji}/@me`
|
|
235
|
-
)
|
|
229
|
+
return this.request<void>('DELETE', `/channels/${channelId}/messages/${messageId}/reactions/${encodedEmoji}/@me`)
|
|
236
230
|
}
|
|
237
231
|
|
|
238
232
|
async ackMessage(channelId: string, messageId: string): Promise<void> {
|
|
@@ -245,10 +239,7 @@ export class DiscordClient {
|
|
|
245
239
|
interface GuildMember {
|
|
246
240
|
user: DiscordUser
|
|
247
241
|
}
|
|
248
|
-
const members = await this.request<GuildMember[]>(
|
|
249
|
-
'GET',
|
|
250
|
-
`/guilds/${serverId}/members?limit=1000`
|
|
251
|
-
)
|
|
242
|
+
const members = await this.request<GuildMember[]>('GET', `/guilds/${serverId}/members?limit=1000`)
|
|
252
243
|
return members.map((m) => m.user)
|
|
253
244
|
}
|
|
254
245
|
|
|
@@ -266,10 +257,7 @@ export class DiscordClient {
|
|
|
266
257
|
interface MessageWithAttachments extends DiscordMessage {
|
|
267
258
|
attachments: DiscordFile[]
|
|
268
259
|
}
|
|
269
|
-
const message = await this.requestFormData<MessageWithAttachments>(
|
|
270
|
-
`/channels/${channelId}/messages`,
|
|
271
|
-
formData
|
|
272
|
-
)
|
|
260
|
+
const message = await this.requestFormData<MessageWithAttachments>(`/channels/${channelId}/messages`, formData)
|
|
273
261
|
|
|
274
262
|
return message.attachments[0]
|
|
275
263
|
}
|
|
@@ -278,10 +266,7 @@ export class DiscordClient {
|
|
|
278
266
|
interface MessageWithAttachments extends DiscordMessage {
|
|
279
267
|
attachments: DiscordFile[]
|
|
280
268
|
}
|
|
281
|
-
const messages = await this.request<MessageWithAttachments[]>(
|
|
282
|
-
'GET',
|
|
283
|
-
`/channels/${channelId}/messages?limit=100`
|
|
284
|
-
)
|
|
269
|
+
const messages = await this.request<MessageWithAttachments[]>('GET', `/channels/${channelId}/messages?limit=100`)
|
|
285
270
|
|
|
286
271
|
const files: DiscordFile[] = []
|
|
287
272
|
for (const msg of messages) {
|
|
@@ -334,25 +319,18 @@ export class DiscordClient {
|
|
|
334
319
|
return this.request<DiscordRelationship[]>('GET', '/users/@me/relationships')
|
|
335
320
|
}
|
|
336
321
|
|
|
337
|
-
async searchMembers(
|
|
338
|
-
guildId: string,
|
|
339
|
-
query: string,
|
|
340
|
-
limit: number = 10
|
|
341
|
-
): Promise<DiscordGuildMember[]> {
|
|
322
|
+
async searchMembers(guildId: string, query: string, limit: number = 10): Promise<DiscordGuildMember[]> {
|
|
342
323
|
const params = new URLSearchParams()
|
|
343
324
|
params.set('query', query)
|
|
344
325
|
params.set('limit', limit.toString())
|
|
345
326
|
|
|
346
|
-
return this.request<DiscordGuildMember[]>(
|
|
347
|
-
'GET',
|
|
348
|
-
`/guilds/${guildId}/members/search?${params.toString()}`
|
|
349
|
-
)
|
|
327
|
+
return this.request<DiscordGuildMember[]>('GET', `/guilds/${guildId}/members/search?${params.toString()}`)
|
|
350
328
|
}
|
|
351
329
|
|
|
352
330
|
async searchMessages(
|
|
353
331
|
guildId: string,
|
|
354
332
|
query: string,
|
|
355
|
-
options: DiscordSearchOptions = {}
|
|
333
|
+
options: DiscordSearchOptions = {},
|
|
356
334
|
): Promise<{ results: DiscordSearchResult[]; total: number }> {
|
|
357
335
|
const params = new URLSearchParams()
|
|
358
336
|
params.set('content', query)
|
|
@@ -381,7 +359,7 @@ export class DiscordClient {
|
|
|
381
359
|
|
|
382
360
|
const response = await this.request<DiscordSearchResponse>(
|
|
383
361
|
'GET',
|
|
384
|
-
`/guilds/${guildId}/messages/search?${params.toString()}
|
|
362
|
+
`/guilds/${guildId}/messages/search?${params.toString()}`,
|
|
385
363
|
)
|
|
386
364
|
|
|
387
365
|
const results = response.messages
|
|
@@ -413,7 +391,7 @@ export class DiscordClient {
|
|
|
413
391
|
options?: {
|
|
414
392
|
auto_archive_duration?: number
|
|
415
393
|
rate_limit_per_user?: number
|
|
416
|
-
}
|
|
394
|
+
},
|
|
417
395
|
): Promise<DiscordChannel> {
|
|
418
396
|
return this.request<DiscordChannel>('POST', `/channels/${channelId}/threads`, {
|
|
419
397
|
name,
|
|
@@ -34,14 +34,9 @@ beforeEach(() => {
|
|
|
34
34
|
servers: {},
|
|
35
35
|
})
|
|
36
36
|
|
|
37
|
-
credManagerSaveSpy = spyOn(DiscordCredentialManager.prototype, 'save').mockResolvedValue(
|
|
38
|
-
undefined
|
|
39
|
-
)
|
|
37
|
+
credManagerSaveSpy = spyOn(DiscordCredentialManager.prototype, 'save').mockResolvedValue(undefined)
|
|
40
38
|
|
|
41
|
-
credManagerClearTokenSpy = spyOn(
|
|
42
|
-
DiscordCredentialManager.prototype,
|
|
43
|
-
'clearToken'
|
|
44
|
-
).mockResolvedValue(undefined)
|
|
39
|
+
credManagerClearTokenSpy = spyOn(DiscordCredentialManager.prototype, 'clearToken').mockResolvedValue(undefined)
|
|
45
40
|
})
|
|
46
41
|
|
|
47
42
|
afterEach(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from 'commander'
|
|
2
|
-
import { handleError } from '
|
|
3
|
-
import { formatOutput } from '
|
|
2
|
+
import { handleError } from '@/shared/utils/error-handler'
|
|
3
|
+
import { formatOutput } from '@/shared/utils/output'
|
|
4
4
|
import { DiscordClient } from '../client'
|
|
5
5
|
import { DiscordCredentialManager } from '../credential-manager'
|
|
6
6
|
import { DiscordTokenExtractor } from '../token-extractor'
|
|
@@ -36,12 +36,11 @@ export async function extractAction(options: { pretty?: boolean; debug?: boolean
|
|
|
36
36
|
console.log(
|
|
37
37
|
formatOutput(
|
|
38
38
|
{
|
|
39
|
-
error:
|
|
40
|
-
'No Discord token found. Make sure Discord desktop app is installed and logged in.',
|
|
39
|
+
error: 'No Discord token found. Make sure Discord desktop app is installed and logged in.',
|
|
41
40
|
hint: options.debug ? undefined : 'Run with --debug for more info.',
|
|
42
41
|
},
|
|
43
|
-
options.pretty
|
|
44
|
-
)
|
|
42
|
+
options.pretty,
|
|
43
|
+
),
|
|
45
44
|
)
|
|
46
45
|
process.exit(1)
|
|
47
46
|
}
|
|
@@ -76,8 +75,8 @@ export async function extractAction(options: { pretty?: boolean; debug?: boolean
|
|
|
76
75
|
{
|
|
77
76
|
error: 'No servers found. Make sure you are a member of at least one Discord server.',
|
|
78
77
|
},
|
|
79
|
-
options.pretty
|
|
80
|
-
)
|
|
78
|
+
options.pretty,
|
|
79
|
+
),
|
|
81
80
|
)
|
|
82
81
|
process.exit(1)
|
|
83
82
|
}
|
|
@@ -117,8 +116,8 @@ export async function extractAction(options: { pretty?: boolean; debug?: boolean
|
|
|
117
116
|
error: `Token validation failed: ${(error as Error).message}`,
|
|
118
117
|
hint: 'Make sure your Discord token is valid and has not expired.',
|
|
119
118
|
},
|
|
120
|
-
options.pretty
|
|
121
|
-
)
|
|
119
|
+
options.pretty,
|
|
120
|
+
),
|
|
122
121
|
)
|
|
123
122
|
process.exit(1)
|
|
124
123
|
}
|
|
@@ -133,9 +132,7 @@ export async function logoutAction(options: { pretty?: boolean }): Promise<void>
|
|
|
133
132
|
const config = await credManager.load()
|
|
134
133
|
|
|
135
134
|
if (!config.token) {
|
|
136
|
-
console.log(
|
|
137
|
-
formatOutput({ error: 'Not authenticated. Run "auth extract" first.' }, options.pretty)
|
|
138
|
-
)
|
|
135
|
+
console.log(formatOutput({ error: 'Not authenticated. Run "auth extract" first.' }, options.pretty))
|
|
139
136
|
process.exit(1)
|
|
140
137
|
}
|
|
141
138
|
|
|
@@ -153,9 +150,7 @@ export async function statusAction(options: { pretty?: boolean }): Promise<void>
|
|
|
153
150
|
const config = await credManager.load()
|
|
154
151
|
|
|
155
152
|
if (!config.token) {
|
|
156
|
-
console.log(
|
|
157
|
-
formatOutput({ error: 'Not authenticated. Run "auth extract" first.' }, options.pretty)
|
|
158
|
-
)
|
|
153
|
+
console.log(formatOutput({ error: 'Not authenticated. Run "auth extract" first.' }, options.pretty))
|
|
159
154
|
process.exit(1)
|
|
160
155
|
}
|
|
161
156
|
|
|
@@ -190,17 +185,17 @@ export const authCommand = new Command('auth')
|
|
|
190
185
|
.description('Extract token from Discord desktop app')
|
|
191
186
|
.option('--pretty', 'Pretty print JSON output')
|
|
192
187
|
.option('--debug', 'Show debug output for troubleshooting')
|
|
193
|
-
.action(extractAction)
|
|
188
|
+
.action(extractAction),
|
|
194
189
|
)
|
|
195
190
|
.addCommand(
|
|
196
191
|
new Command('logout')
|
|
197
192
|
.description('Logout from Discord')
|
|
198
193
|
.option('--pretty', 'Pretty print JSON output')
|
|
199
|
-
.action(logoutAction)
|
|
194
|
+
.action(logoutAction),
|
|
200
195
|
)
|
|
201
196
|
.addCommand(
|
|
202
197
|
new Command('status')
|
|
203
198
|
.description('Show authentication status')
|
|
204
199
|
.option('--pretty', 'Pretty print JSON output')
|
|
205
|
-
.action(statusAction)
|
|
200
|
+
.action(statusAction),
|
|
206
201
|
)
|
|
@@ -15,29 +15,27 @@ beforeEach(() => {
|
|
|
15
15
|
{ id: 'ch-3', guild_id: 'guild-1', name: 'voice-channel', type: 2, topic: undefined },
|
|
16
16
|
])
|
|
17
17
|
|
|
18
|
-
clientGetChannelSpy = spyOn(DiscordClient.prototype, 'getChannel').mockImplementation(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
topic: 'General discussion',
|
|
27
|
-
}
|
|
18
|
+
clientGetChannelSpy = spyOn(DiscordClient.prototype, 'getChannel').mockImplementation(async (channelId: string) => {
|
|
19
|
+
if (channelId === 'ch-1') {
|
|
20
|
+
return {
|
|
21
|
+
id: 'ch-1',
|
|
22
|
+
guild_id: 'guild-1',
|
|
23
|
+
name: 'general',
|
|
24
|
+
type: 0,
|
|
25
|
+
topic: 'General discussion',
|
|
28
26
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
}
|
|
28
|
+
if (channelId === 'ch-2') {
|
|
29
|
+
return {
|
|
30
|
+
id: 'ch-2',
|
|
31
|
+
guild_id: 'guild-1',
|
|
32
|
+
name: 'announcements',
|
|
33
|
+
type: 0,
|
|
34
|
+
topic: 'Announcements',
|
|
37
35
|
}
|
|
38
|
-
throw new Error('Channel not found')
|
|
39
36
|
}
|
|
40
|
-
|
|
37
|
+
throw new Error('Channel not found')
|
|
38
|
+
})
|
|
41
39
|
|
|
42
40
|
clientGetMessagesSpy = spyOn(DiscordClient.prototype, 'getMessages').mockResolvedValue([
|
|
43
41
|
{
|