Implemented todo creation and removal, still seems to have an error...
This commit is contained in:
parent
be87983665
commit
d0824613a9
|
@ -1,5 +1,5 @@
|
|||
import discord
|
||||
from bot.bot import Bot
|
||||
from bot import Bot
|
||||
|
||||
# Import specifics commands
|
||||
from todos_manager.todos_commands import *
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import discord
|
||||
from discord.ext import commands
|
||||
from bot import Bot
|
||||
|
||||
# Manager controlled by
|
||||
|
@ -7,6 +8,15 @@ from todos_manager import *
|
|||
def setup_todos_manager_commands(bot: Bot):
|
||||
@bot.client.tree.command(name="create_todo", description="Create a new todo list")
|
||||
async def create_todo(interaction: discord.Interaction, todo_list_name: str):
|
||||
bot.todos_manager.create_todo(interaction.user.id.__str__(), todo_list_name)
|
||||
result = bot.todos_manager.create_todo(interaction.user.id.__str__(), todo_list_name)
|
||||
if result:
|
||||
await interaction.response.send_message(f"Todo list \"{todo_list_name}\" already exists")
|
||||
await interaction.response.send_message(f"Todo list \"{todo_list_name}\" successfully created !")
|
||||
print(result)
|
||||
|
||||
@bot.client.tree.command(name="remove_todo", description="Remove an existing todo list")
|
||||
async def remove_todo(interaction: discord.Interaction, todo_list_name: str):
|
||||
result = bot.todos_manager.remove_todo(interaction.user.id.__str__(), todo_list_name)
|
||||
if result:
|
||||
await interaction.response.send_message(f"Todo list \"{todo_list_name}\" doesn't exists")
|
||||
await interaction.response.send_message(f"Todo list \"{todo_list_name}\" successfully removed !")
|
||||
|
|
Loading…
Reference in New Issue