File tree 6 files changed +2858
-18135
lines changed
6 files changed +2858
-18135
lines changed Original file line number Diff line number Diff line change @@ -400,17 +400,20 @@ export async function initializeClients(
400
400
elizaLogger . log ( "client keys" , Object . keys ( clients ) ) ;
401
401
402
402
// TODO: Add Slack client to the list
403
+ // Initialize clients as an object
404
+
405
+
403
406
if ( clientTypes . includes ( "slack" ) ) {
404
407
const slackClient = await SlackClientInterface . start ( runtime ) ;
405
- if ( slackClient ) clients . push ( slackClient ) ;
408
+ if ( slackClient ) clients . slack = slackClient ; // Use object property instead of push
406
409
}
407
410
408
411
if ( character . plugins ?. length > 0 ) {
409
412
for ( const plugin of character . plugins ) {
410
- // if plugin has clients, add those..
411
413
if ( plugin . clients ) {
412
414
for ( const client of plugin . clients ) {
413
- clients . push ( await client . start ( runtime ) ) ;
415
+ const startedClient = await client . start ( runtime ) ;
416
+ clients [ client . name ] = startedClient ; // Assuming client has a name property
414
417
}
415
418
}
416
419
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " trump" ,
3
- "clients" : [],
3
+ "clients" : [" slack " ],
4
4
"modelProvider" : " openai" ,
5
5
"settings" : {
6
6
"secrets" : {},
Original file line number Diff line number Diff line change 52
52
},
53
53
"dependencies" : {
54
54
"@0glabs/0g-ts-sdk" : " 0.2.1" ,
55
+ "@ai16z/adapter-postgres" : " 0.1.6-alpha.4" ,
55
56
"@coinbase/coinbase-sdk" : " 0.10.0" ,
56
57
"@deepgram/sdk" : " ^3.9.0" ,
57
58
"@vitest/eslint-plugin" : " 1.0.1" ,
Original file line number Diff line number Diff line change @@ -78,6 +78,15 @@ settings:
78
78
7. On the "Basic Information" page, scroll down to "App Credentials"
79
79
8. Copy all the credentials - you'll need them in Step 3
80
80
81
+ ### Step 2.5: Verify Event Subscription
82
+ Before proceeding to install the app, make sure to verify the event subscription:
83
+
84
+ 1. In your Slack App settings, go to "Event Subscriptions."
85
+ 2. Enter the request URL (your ngrok HTTPS URL followed by /slack/events).
86
+ 3. Slack will send a verification request to this URL.
87
+ 4. Ensure your server is running and configured to respond to the url_verification event by echoing back the challenge token provided in the request.
88
+ 5. Once verified, you will see a confirmation in your Slack app settings.
89
+
81
90
### Step 3: Configure Environment Variables
82
91
1. Create or edit ` .env` file in your project root:
83
92
` ` ` bash
Original file line number Diff line number Diff line change @@ -41,4 +41,4 @@ export async function validateSlackConfig(runtime: IAgentRuntime): Promise<Slack
41
41
}
42
42
throw error ;
43
43
}
44
- }
44
+ }
You can’t perform that action at this time.
0 commit comments