Compare commits
2 Commits
2656458253
...
d0824613a9
Author | SHA1 | Date |
---|---|---|
|
d0824613a9 | |
|
be87983665 |
|
@ -1,5 +1,5 @@
|
||||||
import discord
|
import discord
|
||||||
from bot.bot import Bot
|
from bot import Bot
|
||||||
|
|
||||||
# Import specifics commands
|
# Import specifics commands
|
||||||
from todos_manager.todos_commands import *
|
from todos_manager.todos_commands import *
|
||||||
|
|
|
@ -18,7 +18,7 @@ async def on_message(message: discord.Message):
|
||||||
if any(word in words for word in ["oui", "ui", "ouai", "ouaip", "yes", "yep"]) and not message.content.__contains__("?"):
|
if any(word in words for word in ["oui", "ui", "ouai", "ouaip", "yes", "yep"]) and not message.content.__contains__("?"):
|
||||||
await channel.send("trow bienn~ (˶ᵔᵕᵔ˶) ‹𝟹")
|
await channel.send("trow bienn~ (˶ᵔᵕᵔ˶) ‹𝟹")
|
||||||
|
|
||||||
if "<@1169377208893194275>" in words:
|
if message.content.__contains__("<@1169377208893194275>"):
|
||||||
await channel.send("c'est mon mimi nathan qu'on tag ?? ⸜(。˃ ᵕ ˂)⸝♡")
|
await channel.send("c'est mon mimi nathan qu'on tag ?? ⸜(。˃ ᵕ ˂)⸝♡")
|
||||||
|
|
||||||
if "c" in words:
|
if "c" in words:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import discord
|
import discord
|
||||||
|
from discord.ext import commands
|
||||||
from bot import Bot
|
from bot import Bot
|
||||||
|
|
||||||
# Manager controlled by
|
# Manager controlled by
|
||||||
|
@ -7,6 +8,15 @@ from todos_manager import *
|
||||||
def setup_todos_manager_commands(bot: Bot):
|
def setup_todos_manager_commands(bot: Bot):
|
||||||
@bot.client.tree.command(name="create_todo", description="Create a new todo list")
|
@bot.client.tree.command(name="create_todo", description="Create a new todo list")
|
||||||
async def create_todo(interaction: discord.Interaction, todo_list_name: str):
|
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 !")
|
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