Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add slack plugin #859

Merged
merged 5 commits into from
Dec 14, 2024
Merged

Add slack plugin #859

merged 5 commits into from
Dec 14, 2024

Conversation

AIFlowML
Copy link
Collaborator

@AIFlowML AIFlowML commented Dec 5, 2024

Add Slack Integration for Eliza AI Agent

Overview

This PR adds a new Slack client integration for the Eliza AI agent, enabling seamless communication between Slack workspaces and the Eliza AI system. The integration includes robust message handling, conversation management, and standalone example scripts for easy testing and deployment.

Features

  • Full Slack bot integration with event handling and message management
  • Message deduplication system to prevent duplicate responses
  • Thread-aware conversation handling
  • Support for attachments and media files
  • Conversation summarization capabilities
  • Standalone example scripts for testing and development

Example Scripts

The package includes several standalone scripts in packages/client-slack/src/examples/:

  1. standalone-example.ts

    • Basic bot setup and connection
    • Demonstrates message sending, threading, and image attachments
    • Includes error handling and port management
  2. standalone-summarize.ts

    • Shows conversation summarization capabilities
    • Demonstrates handling attachments and threaded discussions
  3. standalone-attachment.ts

    • Comprehensive attachment handling
    • File upload and sharing capabilities

Setup and Configuration

1. Slack App Creation

Slack App Creation

  • Create a new Slack app using the provided manifest
  • Configure bot permissions and event subscriptions

2. Bot Configuration

Bot Configuration

  • Set up OAuth scopes and bot token
  • Configure event subscriptions and interactive components

Testing Instructions

Running Example Scripts

  1. Set up environment variables in .env:

    SLACK_APP_ID=your_app_id
    SLACK_CLIENT_ID=your_client_id
    SLACK_CLIENT_SECRET=your_client_secret
    SLACK_SIGNING_SECRET=your_signing_secret
    SLACK_BOT_TOKEN=xoxb-your-bot-token
    SLACK_VERIFICATION_TOKEN=your_verification_token
    SLACK_CHANNEL_ID=test_channel_id
  2. Run the basic example:

    ts-node packages/client-slack/src/examples/standalone-example.ts
  3. Test summarization:

    ts-node packages/client-slack/src/examples/standalone-summarize.ts
  4. Try attachment handling:

    ts-node packages/client-slack/src/examples/standalone-attachment.ts

Verifying Integration

  1. Start a new conversation with the bot
  2. Test direct mentions and thread replies
  3. Try uploading files and requesting summaries
  4. Verify message handling in different channel types (DM, public, private)

Technical Details

  • TypeScript-based implementation with full type safety
  • Event-driven architecture for message handling
  • Built-in error handling and logging
  • Configurable message deduplication
  • Extensible provider system for easy customization

Documentation

  • Full setup guide in README.md
  • Example scripts with inline documentation
  • Type definitions for all public APIs
  • Environment configuration guide

Checklist

  • TypeScript implementation with full type coverage
  • Comprehensive example scripts
  • Setup screenshots and documentation
  • Error handling and logging
  • Message deduplication system
  • Thread awareness
  • Attachment handling
  • Environment validation
  • Testing instructions

@CREWorx
Copy link

CREWorx commented Dec 5, 2024

Very useful integration!

Copy link
Collaborator

@sirkitree sirkitree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall this appears to have some really great functionality, looking forward to trying it out further.

Howver there are some path changes in the /docs/ that you probably did not intend to happen (i've seen this happen in other PRs too). Please double check those as I think you'll want to remove them.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These docs changes shouldn't be happening.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nor should these docs changes be happening.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here as well.

@odilitime odilitime added the Plugin_new Mark PRs that are a new plugin label Dec 10, 2024
@lalalune
Copy link
Member

Merged on develop

@lalalune lalalune closed this Dec 14, 2024
@lalalune lalalune reopened this Dec 14, 2024
@lalalune lalalune changed the base branch from main to main-2 December 14, 2024 10:54
@lalalune lalalune merged commit d022c78 into elizaOS:main-2 Dec 14, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Plugin_new Mark PRs that are a new plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants