Skip to content

aparimeet/discord-task-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Discord Task Bot 🤖

A Discord bot for task management with inspirational quotes and reminders. Built to run on Replit with persistent storage using Replit's database.

Features ✨

  • Task Management: Add, delete, edit, and list tasks
  • Inspirational Quotes: Get random inspirational quotes from ZenQuotes API
  • Reminders: Set timed reminders with notifications
  • Bot Control: Toggle bot responses on/off
  • Persistent Storage: Tasks are saved using Replit's database

Commands 📝

Command Description Usage
!hello Say 'Hi' to the bot !hello
!inspire Get an inspirational quote !inspire
!new Add a new task !new Buy groceries
!tasks List all current tasks !tasks
!del Delete a task by number !del 1
!edit Edit a specific task !edit 1 Updated task description
!remind Set a reminder (in hours) !remind 2 Take a break
!responding Toggle bot responses !responding true or !responding false
!commands Show all available commands !commands

Setup on Replit 🔧

Prerequisites

  • A Discord Bot Token
  • A Replit account

Step 1: Create a Discord Bot

  1. Go to the Discord Developer Portal
  2. Click "New Application" and give it a name
  3. Go to the "Bot" section and click "Add Bot"
  4. Copy the bot token (keep it secret!)
  5. Under "Privileged Gateway Intents", enable "Message Content Intent"

Step 2: Invite Bot to Your Server

  1. In the Discord Developer Portal, go to "OAuth2" > "URL Generator"
  2. Select "bot" under Scopes
  3. Select "Send Messages" and "Read Message History" under Bot Permissions
  4. Use the generated URL to invite the bot to your server

Step 3: Deploy on Replit

  1. Fork/Import this repository to Replit
  2. In your Replit project, go to the "Secrets" tab (lock icon)
  3. Add a new secret:
    • Key: TOKEN
    • Value: Your Discord bot token
  4. Install the required dependencies by running:
    pip install discord.py requests
  5. Create a keep_alive.py file (for 24/7 hosting):
    from flask import Flask
    from threading import Thread
    
    app = Flask('')
    
    @app.route('/')
    def home():
        return "Bot is alive!"
    
    def run():
        app.run(host='0.0.0.0', port=8080)
    
    def keep_alive():
        t = Thread(target=run)
        t.start()
  6. Run the bot by clicking the "Run" button

Step 4: Keep Bot Online 24/7 (Optional)

  1. Copy your Replit project URL
  2. Use a service like UptimeRobot to ping your bot every 5 minutes
  3. This prevents Replit from putting your bot to sleep

Usage Examples 📋

# Add some tasks
!new Complete project documentation
!new Review pull requests
!new Prepare for meeting

# View all tasks
!tasks

# Edit a task
!edit 2 Review and merge pull requests

# Set a reminder
!remind 1 Stand-up meeting in 1 hour

# Delete a completed task
!del 1

# Get motivation
!inspire

File Structure 📁

discord-task-bot/
├── main.py          # Main bot code
├── keep_alive.py    # Web server for 24/7 hosting
├── README.md        # This file
└── LICENSE          # MIT License

Dependencies 📦

  • discord.py - Discord API wrapper
  • requests - HTTP library for API calls
  • replit - Replit database integration
  • flask - Web server for keep-alive functionality

License 📄

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

About

A discord bot for task management

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages