Code Monkey home page Code Monkey logo

feedbacktrackerbot's Introduction

FeedbackTracker

FeedbackTracker is a Slack bot that logs feedback messages from Slack channels into a Google Sheets document. This project is built using Flask, Google Sheets API, and Slack API.

Features

  • Listens for feedback messages in Slack channels.
  • Logs feedback messages along with the user's name, email, and timestamp into a Google Sheets document.

Prerequisites

  • Python 3.9+
  • A Google Cloud Platform project with Google Sheets API enabled.
  • A Slack workspace with a Slack app that has the necessary permissions.

Setup

Google Sheets API Setup

  1. Create a Project in Google Cloud Console:

  2. Enable Google Sheets API:

    • In the Google Cloud Console, go to the API & Services Dashboard.
    • Click on "Enable APIs and Services."
    • Search for "Google Sheets API" and enable it.
  3. Create Credentials:

    • Go to "Credentials" in the API & Services section.
    • Click "Create Credentials" and select "Service Account."
    • Fill in the required information and create the service account.
    • After creating the service account, create a key for it (preferably JSON).
  4. Share Your Google Sheet with the Service Account:

    • Open your Google Sheet.
    • Click "Share" and add the email address of your service account (found in the JSON file) with edit access.

Slack App Setup

  1. Create a Slack App:

    • Go to the Slack API dashboard.
    • Create a new app.
  2. Add Bot Scopes:

    • Go to "OAuth & Permissions" and add the following scopes:
      • channels:history
      • chat:write
      • app_mentions:read
      • users:read
      • users:read.email
  3. Enable Event Subscriptions:

    • Go to "Event Subscriptions."
    • Enable events and set the Request URL to http://<your-server-ip>:5000/slack/events.
    • Subscribe to the following bot events:
      • app_mention
      • message.channels
  4. Install the App:

    • Install the app to your Slack workspace and copy the OAuth token.

Installation

  1. Clone the Repository:

    git clone https://github.com/your-username/FeedbackTracker.git
    cd FeedbackTracker
  2. Create a Virtual Environment:

    python3 -m venv venv
    source venv/bin/activate
  3. Install Dependencies:

    pip install -r requirements.txt
  4. Set Up Environment Variables: Create a .env file in the project root and add the following variables:

    SLACK_BOT_TOKEN=xoxb-your-slack-bot-token
    SPREADSHEET_ID=your-google-sheets-id
    SERVICE_ACCOUNT_FILE=path/to/your/service-account-file.json
    

Running the Application

  1. Start the Flask Application:

    gunicorn --bind 0.0.0.0:5000 app:app
  2. Use ngrok for HTTPS (if needed):

    ngrok http 5000

Usage

  • Mention the bot in any Slack channel with your feedback.
  • The bot will log the feedback, along with your name, email, and the timestamp, into the specified Google Sheets document.

Example

Feedback Message in Slack

@FeedbackTrackerBot I love UGC!

Logged in Google Sheets

Date Time User Name Feedback
2024-07-15 08:56:20 Abhijoy Sarkar [email protected] I love UGC!

Contributing

Contributions are welcome! Please create a pull request with your changes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

feedbacktrackerbot's People

Contributors

acebot712 avatar

Watchers

 avatar

feedbacktrackerbot's Issues

User specified sheet ID

Add generic functionality where user can specify sheet ID when installing bot and can also change it later if they need to.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.