Redid Dolly's code

This commit is contained in:
Dan
2024-05-03 22:38:27 -04:00
parent 4ea2ffb162
commit e28176b558
4 changed files with 80 additions and 0 deletions

15
dolly/commands.py Normal file
View File

@@ -0,0 +1,15 @@
import discord
from discord import app_commands
from .database import add_project, add_task
class DollyProjectTrackerCommands(app_commands.Group):
@tree.command(name="create-project", description="Create a new project in the database.")
async def create_project(self, interaction: discord.Interaction, name: str, description: str):
await add_project(name, description)
await interaction.response.send_message(f"Project `{name}` created successfully.")
@tree.command(name="add-task", description="Add a new task to a project in the database.")
async def add_task(self, interaction: discord.Interaction, project_name: str, description: str, assignee: str, deadline: str, status: str, priority: str):
await add_task(project_name, description, assignee, deadline, status, priority)
await interaction.response.send_message(f"Task `{description}` added to project `{project_name}` successfully.")