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

Guide for creating Slack bot app #205

Closed
wants to merge 2 commits into from

Conversation

SambhavSetia
Copy link

@SambhavSetia SambhavSetia commented Jun 22, 2024

User description

fixes#161


PR Type

documentation


Description

  • Added a detailed guide for creating a Slack bot app using Composio.
  • Included prerequisites and step-by-step instructions for setting up the Slack app, bot user, and OAuth & permissions.
  • Provided code examples and instructions for developing the bot with Node.js, including environment setup and required packages.
  • Detailed the process of integrating Composio, setting up triggers, and testing the bot.

Changes walkthrough 📝

Relevant files
Documentation
slack_bot_app.mdx
Added guide for creating and setting up a Slack bot app   

docs/guides/slack_bot_app.mdx

  • Added a comprehensive guide for creating a Slack bot app using
    Composio.
  • Included steps for setting up Slack app, bot user, OAuth &
    permissions.
  • Provided instructions for developing the bot with Node.js and
    integrating Composio.
  • Detailed steps for setting up triggers in Composio and testing the
    bot.
  • +124/-0 

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    @codiumai-pr-agent-pro codiumai-pr-agent-pro bot added documentation Improvements or additions to documentation Review effort [1-5]: 2 labels Jun 22, 2024
    Copy link

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review [1-5] 2
    🧪 Relevant tests No
    🔒 Security concerns No
    ⚡ Key issues to review None

    Copy link

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Security
    Add a security note to remind users to keep their OAuth access token and other credentials secure

    Add a note to remind users to keep their OAuth access token and other credentials secure
    and not to share them publicly.

    docs/guides/slack_bot_app.mdx [40]

     3:Install App: Scroll up to the OAuth Tokens & Redirect URLs section and click Install App to Workspace. This will generate an OAuth access token which will be used to authenticate your bot.
     
    +> **Note:** Keep your OAuth access token and other credentials secure and do not share them publicly.
    +
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Adding a security note is crucial to ensure users are aware of the importance of keeping credentials secure. This suggestion addresses a significant security concern.

    8
    Best practice
    Include a step to install the dotenv package for managing environment variables

    Include a step to install the dotenv package to manage environment variables more securely
    and conveniently.

    docs/guides/slack_bot_app.mdx [56-57]

     npm install @slack/bolt
     npm install composio-sdk
    +npm install dotenv
     
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: Installing the dotenv package is a best practice for managing environment variables securely and conveniently, enhancing the project setup.

    7
    Add a step to require and configure the dotenv package at the beginning of the index.js file

    Add a step to require and configure the dotenv package at the beginning of the index.js
    file to load environment variables from the .env file.

    docs/guides/slack_bot_app.mdx [63-64]

    +require('dotenv').config();
     const { App } = require('@slack/bolt');
     const composio = require('composio-sdk');
     
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: This suggestion promotes best practices by ensuring environment variables are loaded securely and is essential for maintaining the functionality of the application when using .env.

    7
    Readability
    Use bullet points instead of numbered lists for the prerequisites section

    To improve readability and consistency, use bullet points instead of numbered lists for
    the prerequisites section.

    docs/guides/slack_bot_app.mdx [8-10]

    -1:Slack Workspace: You need to have a Slack workspace where you have administrative privileges.
    -2:Composio Account: Sign up for an account on Composio (if required).
    -3:Basic Programming Knowledge: Familiarity with JavaScript and Node.js is beneficial.
    +- Slack Workspace: You need to have a Slack workspace where you have administrative privileges.
    +- Composio Account: Sign up for an account on Composio (if required).
    +- Basic Programming Knowledge: Familiarity with JavaScript and Node.js is beneficial.
     
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: Changing to bullet points improves readability and consistency, but it's a minor stylistic change rather than a functional improvement.

    6

    @utkarsh-dixit
    Copy link
    Collaborator

    Summary of Changes:

    This pull request adds a new guide to the project. The guide is focused on creating a Slack bot app using Composio and setting up triggers for specific events or commands. The file docs/guides/slack_bot_app.mdx has been added with the following content:

    • Steps to create a Slack app.
    • Steps to add a bot user to the Slack app.
    • Setting up OAuth & permissions in Slack.
    • Creating a project in Composio and integrating it with Slack.
    • Developing the bot using Node.js and Composio SDK.
    • Setting up triggers in Composio based on Slack events.
    • Testing the bot in Slack channels.

    Type of PR:

    • Doc

    Important Change File:

    • docs/guides/slack_bot_app.mdx

    This guide will help users to easily create and set up a Slack bot app and integrate it with Composio for automated triggers and responses based on specific events or commands in Slack.

    @utkarsh-dixit
    Copy link
    Collaborator

    Closing this pull request, primarily because

    • it's not using Composio Slackbot at all, in the guide slack bolt SDK is getting used instead of Composio Actions and triggers.
    • Instructions related to Composio are incorrect, there's no way to create a project in composio and give it a name.

    Feel free to reopen this pull-request if you have fixed these issues

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    documentation Improvements or additions to documentation Review effort [1-5]: 2
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants