help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • Blog
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
slack-bot-assistant
/
bot
/
__pycache__
RSK World
slack-bot-assistant
Slack Bot Assistant - Python + Slack API + SQLite + PHP Dashboard + Bot Commands + Automation
__pycache__
  • app.cpython-313.pyc34.9 KB
  • config.cpython-313.pyc2.3 KB
  • helpers.cpython-313.pyc7.7 KB
  • models.cpython-313.pyc6.1 KB
  • scheduler.cpython-313.pyc5.3 KB
  • utils.cpython-313.pyc15.2 KB
run.pyLICENSEREADME.md
run.py
Raw Download
Find: Go to:
#!/usr/bin/env python3
"""
Slack Bot Assistant - Main Entry Point
Developer: Molla Samser (Founder, RSK World)
Design & Testing: Rima Khatun
Website: https://rskworld.in
Contact: hello@rskworld.in | +91 93305 39277
Year: 2026
"""

import sys
import os

# Add bot directory to path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'bot'))

from bot.app import app
from bot.config import Config
from slack_bolt.adapter.socket_mode import SocketModeHandler

def main():
    """Main entry point for the Slack Bot Assistant"""
    print("=" * 60)
    print("šŸš€ Slack Bot Assistant - Advanced Edition")
    print("=" * 60)
    print(f"\nšŸ“Š Configuration Status:")
    print(f"   Database: {'āœ… Enabled' if Config.ENABLE_DATABASE else 'āŒ Disabled'}")
    print(f"   Scheduling: {'āœ… Enabled' if Config.ENABLE_SCHEDULING else 'āŒ Disabled'}")
    print(f"   Weather API: {'āœ… Enabled' if Config.ENABLE_WEATHER else 'āŒ Disabled'}")
    print(f"   Translation: {'āœ… Enabled' if Config.ENABLE_TRANSLATION else 'āŒ Disabled'}")
    print(f"   File Handling: {'āœ… Enabled' if Config.ENABLE_FILE_HANDLING else 'āŒ Disabled'}")
    print("=" * 60)
    
    # Check required configuration
    if not Config.SLACK_BOT_TOKEN:
        print("\nāŒ ERROR: SLACK_BOT_TOKEN is not set!")
        print("   Please set SLACK_BOT_TOKEN in your .env file or environment variables.")
        sys.exit(1)
    
    if not Config.SLACK_SIGNING_SECRET:
        print("\nāŒ ERROR: SLACK_SIGNING_SECRET is not set!")
        print("   Please set SLACK_SIGNING_SECRET in your .env file or environment variables.")
        sys.exit(1)
    
    if not Config.SLACK_APP_TOKEN:
        print("\nāŒ ERROR: SLACK_APP_TOKEN is not set!")
        print("   Please set SLACK_APP_TOKEN in your .env file or environment variables.")
        print("   Socket Mode requires an App-Level Token.")
        sys.exit(1)
    
    print("\nāœ… All required configuration found!")
    print("\nšŸ”„ Starting bot...\n")
    
    try:
        # Start the app using Socket Mode
        handler = SocketModeHandler(app, Config.SLACK_APP_TOKEN)
        handler.start()
        print("āœ… Bot is running and listening for events...")
        print("   Press Ctrl+C to stop the bot.\n")
    except KeyboardInterrupt:
        print("\n\nšŸ‘‹ Bot stopped by user. Goodbye!")
        sys.exit(0)
    except Exception as e:
        print(f"\nāŒ Error starting bot: {e}")
        print("\nšŸ’” Troubleshooting:")
        print("   1. Check that all tokens are correct")
        print("   2. Verify Socket Mode is enabled in your Slack app settings")
        print("   3. Ensure your app is installed to your workspace")
        print("   4. Check the logs for more details")
        sys.exit(1)

if __name__ == "__main__":
    main()

75 lines•2.8 KB
python
LICENSE
Raw Download
Find: Go to:
Copyright (c) 2026 RSK World

All rights reserved.

This software and associated documentation files (the "Software") are the proprietary
and confidential property of RSK World. 

NO PART OF THIS SOFTWARE MAY BE REPRODUCED, DISTRIBUTED, OR TRANSMITTED IN ANY FORM OR
BY ANY MEANS, INCLUDING PHOTOCOPYING, RECORDING, OR OTHER ELECTRONIC OR MECHANICAL
METHODS, WITHOUT THE PRIOR WRITTEN PERMISSION OF RSK World, EXCEPT IN THE CASE OF
BRIEF QUOTATIONS EMBODIED IN CRITICAL REVIEWS AND CERTAIN OTHER NONCOMMERCIAL USES
PERMITTED BY COPYRIGHT LAW.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.

For licensing inquiries, please contact:
Email: hello@rskworld.in
Website: https://rskworld.in
Phone: +91 93305 39277

---

Developed by: Molla Samser (Founder, RSK World)
Design & Testing: Rima Khatun
Year: 2026

Ā© 2026 RSK World. All rights reserved.

34 lines•1.3 KB
text
README.md
Raw Download

README.md

# Slack Bot Assistant šŸš€

A powerful, enterprise-grade Slack bot designed for team collaboration, productivity automation, and AI assistance with advanced features.

## 🌟 Key Features

### Core Features
- **AI Assistance**: Get instant answers and task management help with adaptive personalities
- **Advanced Sentiment Analysis**: VADER-powered sentiment detection (URGENT/POSITIVE/NEGATIVE/NEUTRAL)
- **Adaptive Personalities**: Switch between Professional, Casual, Technical, Friendly, and Formal AI modes
- **Multi-language Support**: English, Hindi, Spanish, French, German (expandable)
- **Workflow Automation**: Custom shortcuts and slash commands for daily tasks

### Advanced Task Management
- **Task Creation & Tracking**: Full CRUD operations for tasks with priorities and due dates
- **Task Lists**: View and filter tasks by status (pending, in_progress, completed)
- **Priority System**: Low, Medium, High, and Urgent priority levels
- **Due Date Management**: Flexible date parsing (relative and absolute dates)

### Productivity Tools
- **Smart Reminders**: Scheduled reminders with natural language time parsing
- **Meeting Summaries**: AI-powered summaries from channel conversations
- **Standup Templates**: Quick standup format generation
- **Poll Creation**: Interactive polls for team decisions

### Analytics & Insights
- **Channel Analytics**: Comprehensive channel health reports
- **Sentiment Tracking**: Historical sentiment analysis data
- **Command Analytics**: Usage statistics and patterns
- **Real-time Dashboard**: Live metrics and visualizations

### Database Integration
- **SQLite/PostgreSQL Support**: Flexible database backend
- **User Preferences**: Persistent user settings and configurations
- **Data Persistence**: All reminders, tasks, and summaries saved
- **Analytics Storage**: Command history and sentiment data

### External Integrations
- **Weather API**: Get weather information (OpenWeatherMap)
- **Translation APIs**: Multi-language support (expandable)

## šŸ› ļø Technologies

### Backend
- **Python 3.8+**
- **Slack Bolt Framework** - Official Slack SDK
- **SQLAlchemy** - Database ORM
- **VADER Sentiment** - Advanced sentiment analysis
- **Requests** - HTTP client for API integrations

### Frontend (Dashboard)
- **HTML5/CSS3** - Modern, responsive design
- **Chart.js** - Interactive data visualization
- **Font Awesome** - Icon library

## šŸš€ Quick Start

### Prerequisites
- Python 3.8 or higher
- Slack Workspace with Admin permissions
- Slack App created at [api.slack.com/apps](https://api.slack.com/apps)

### Installation

1. **Clone the repository**
```bash
git clone <repository-url>
cd slack-bot-assistant
```

2. **Create virtual environment**
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```

3. **Install dependencies**
```bash
pip install -r requirements.txt
```

4. **Configure environment variables**
```bash
cp .env.example .env
# Edit .env with your Slack credentials
```

5. **Set up Slack App**
- Go to [api.slack.com/apps](https://api.slack.com/apps)
- Create a new app or use existing one
- Enable Socket Mode
- Add required OAuth scopes (see SETUP.md for details)
- Install app to your workspace
- Copy tokens to `.env` file

6. **Run the bot**
```bash
python bot/app.py
```

For detailed setup instructions, see [SETUP.md](SETUP.md).

## šŸ“‹ Available Commands

### Basic Commands
- `/help` - Show all available commands
- `/bot-settings` - Configure bot personality and language preferences

### Task Management
- `/task-create <title> | <description> | <priority> | <due_date>` - Create a new task
- Example: `/task-create Fix login bug | Update authentication logic | high | tomorrow 5pm`
- `/task-list` - List your active tasks with filters

### Productivity
- `/set-reminder <message> | <time>` - Set a smart reminder
- Example: `/set-reminder Team meeting | in 2 hours`
- Supports: "in X hours/days", "tomorrow 10am", ISO dates
- `/summarize-meeting` - Generate meeting summary from recent channel messages
- `/standup` - Get daily standup template

### Team Collaboration
- `/manage-channel` - Get comprehensive channel analytics and management report
- `/poll <question> | <option1> | <option2> | ...` - Create interactive polls
- Example: `/poll Best meeting time? | 9am | 2pm | 5pm`

### Utilities
- `/weather <location>` - Get weather information (requires OpenWeather API key)
- Example: `/weather New York`
- `/quote` - Get a random motivational quote
- `/random` - Generate random number or choose from options
- Example: `/random` (1-100) or `/random 1-50` or `/random option1, option2, option3`
- `/translate <text> | <language>` - Translate text (basic, expandable with API)
- Example: `/translate Hello | Hindi`
- `/note <text>` - Create and save a quick note
- Example: `/note Remember to update docs tomorrow`

### Mentions
Mention `@BotAssistant` in any channel for AI-powered assistance with contextual responses!

## šŸ—ļø Project Structure

```
slack-bot-assistant/
ā”œā”€ā”€ bot/
│ ā”œā”€ā”€ app.py # Main bot application with all handlers
│ ā”œā”€ā”€ config.py # Centralized configuration management
│ ā”œā”€ā”€ models.py # Database models and schema
│ ā”œā”€ā”€ utils.py # Utility functions (sentiment, formatting, etc.)
│ ā”œā”€ā”€ helpers.py # Additional helper functions
│ └── scheduler.py # Advanced task scheduling system
ā”œā”€ā”€ demo.html # Advanced analytics dashboard
ā”œā”€ā”€ index.html # Landing page
ā”œā”€ā”€ run.py # Main entry point script
ā”œā”€ā”€ requirements.txt # Python dependencies
ā”œā”€ā”€ SETUP.md # Detailed setup guide
ā”œā”€ā”€ FEATURES.md # Comprehensive feature list
ā”œā”€ā”€ CHANGELOG.md # Version history and changes
ā”œā”€ā”€ .env.example # Environment variables template
ā”œā”€ā”€ .gitignore # Git ignore file
└── README.md # This file
```

## āš™ļø Configuration

### Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `SLACK_BOT_TOKEN` | Yes | Bot User OAuth Token from Slack |
| `SLACK_SIGNING_SECRET` | Yes | Signing Secret from Slack |
| `SLACK_APP_TOKEN` | Yes | App-Level Token for Socket Mode |
| `OPENWEATHER_API_KEY` | No | For weather command (get from openweathermap.org) |
| `DATABASE_URL` | No | Database connection string (default: SQLite) |
| `LOG_LEVEL` | No | Logging level (DEBUG, INFO, WARNING, ERROR) |

### Feature Configuration

Edit `bot/config.py` to customize:
- Default personality and language
- Supported languages and personalities
- Feature flags (database, scheduling, etc.)
- Reminder settings and limits
- Meeting summary parameters

## šŸ“Š Database Schema

The bot uses SQLite by default (configurable for PostgreSQL, MySQL, etc.):

- **user_configs** - User preferences (personality, language, timezone)
- **reminders** - Scheduled reminders with timestamps
- **tasks** - Task management with priorities and due dates
- **meeting_summaries** - Generated meeting summaries
- **message_sentiments** - Sentiment analysis data for analytics
- **command_history** - Command usage analytics
- **polls** - Poll data and votes

## šŸ”§ Advanced Features

### Scheduled Reminders
- Background thread checks reminders every 60 seconds (configurable)
- Automatic delivery when reminder time is reached
- Supports up to 50 active reminders per user (configurable)
- Natural language time parsing

### Sentiment Analysis
- VADER sentiment analyzer for accurate sentiment detection
- Falls back to keyword-based analysis if VADER unavailable
- Tracks sentiment scores and confidence levels
- Stores historical sentiment data for analytics

### Task Management
- Full CRUD operations
- Priority levels: Low, Medium, High, Urgent
- Status tracking: Pending, In Progress, Completed, Cancelled
- Flexible due date parsing
- Task filtering and listing

### Meeting Summaries
- Analyzes recent channel messages (configurable count)
- Extracts key topics and action items
- Identifies participants and message volume
- Stores summaries in database for reference

## šŸ“ˆ Dashboard Features

The demo dashboard (`demo.html`) includes:
- Real-time statistics and metrics
- Interactive charts (trends, sentiment, command usage)
- Channel activity heatmap
- Task management interface
- Live bot logs simulation
- Responsive design

## šŸ› Troubleshooting

### Common Issues

**Bot not responding**
- Verify tokens in `.env` file
- Check Socket Mode is enabled in Slack app settings
- Review bot logs for errors

**Database errors**
- Ensure database file permissions
- Check database URL format
- Delete `bot_data.db` to reset (development only)

**Commands not working**
- Verify commands are registered in Slack app
- Check OAuth scopes/permissions
- Review bot logs for error messages

For more troubleshooting tips, see [SETUP.md](SETUP.md).

## šŸ¤ Contributing

This is a proprietary project by RSK World. For inquiries about contributions or licensing, please contact us.

## šŸ‘Øā€šŸ’» Developer Details

- **Founder & Lead Developer**: Molla Samser (RSK World)
- **Design & Testing**: Rima Khatun
- **Website**: [rskworld.in](https://rskworld.in)
- **Contact**: hello@rskworld.in | +91 93305 39277
- **Year**: 2026

## šŸ“„ License

Ā© 2026 RSK World. All rights reserved.

## šŸ”— Resources

- [Slack API Documentation](https://api.slack.com/)
- [Slack Bolt Framework](https://slack.dev/bolt-python/)
- [SQLAlchemy Documentation](https://docs.sqlalchemy.org/)
- [VADER Sentiment](https://github.com/cjhutto/vaderSentiment)

---

**Made with ā¤ļø by RSK World**
šŸš€ Support RSK World

Subscribe to our YouTube channel for latest tutorials & updates!



Click subscribe & support our work ā¤ļø

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer