feat: Implement data processing and visualization utilities
- Added `data_utils.py` for analyzing and visualizing data from CSV/Excel files. - Introduced asynchronous processing to handle file uploads without blocking. - Enhanced error handling for file reading and data conversion. - Implemented various chart types (pie, bar, scatter, histogram, line) based on user queries. - Added metadata management for generated charts, including cleanup of old charts. feat: Create reminder management system for Discord - Added `reminder_utils.py` to manage user reminders in Discord. - Implemented functionality to add, retrieve, delete, and process reminders. - Integrated timezone handling for accurate reminder scheduling. - Developed a loop to check for due reminders and send notifications. - Included parsing for various time formats to set reminders.
This commit is contained in:
8
bot.py
8
bot.py
@@ -9,6 +9,8 @@ import time
|
||||
import logging.config
|
||||
from discord.ext import commands, tasks
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from dotenv import load_dotenv
|
||||
from discord import app_commands
|
||||
|
||||
# Import configuration
|
||||
from src.config.config import (
|
||||
@@ -33,6 +35,9 @@ from src.utils.image_utils import ImageGenerator
|
||||
# Global shutdown flag
|
||||
shutdown_flag = asyncio.Event()
|
||||
|
||||
# Load environment variables
|
||||
load_dotenv()
|
||||
|
||||
# Configure logging with more detail, rotation, and webhook integration
|
||||
def setup_logging():
|
||||
# Apply the dictionary config
|
||||
@@ -172,6 +177,9 @@ async def main():
|
||||
await db_handler.create_indexes()
|
||||
logging.info("Database indexes created")
|
||||
|
||||
# Khởi tạo collection reminders
|
||||
await db_handler.ensure_reminders_collection()
|
||||
|
||||
# Event handler when the bot is ready
|
||||
@bot.event
|
||||
async def on_ready():
|
||||
|
||||
Reference in New Issue
Block a user