create table in own cog
This commit is contained in:
parent
76962e6936
commit
7f3b412953
3 changed files with 4 additions and 4 deletions
|
@ -15,6 +15,7 @@ class ReminderDiscord(commands.Cog, name="Reminder"):
|
||||||
def __init__(self, client):
|
def __init__(self, client):
|
||||||
self.client = client
|
self.client = client
|
||||||
self._reminderLoop.start()
|
self._reminderLoop.start()
|
||||||
|
Reminder().creationTable()
|
||||||
|
|
||||||
@tasks.loop(minutes = 1)
|
@tasks.loop(minutes = 1)
|
||||||
async def _reminderLoop(self):
|
async def _reminderLoop(self):
|
||||||
|
|
|
@ -13,6 +13,7 @@ class ToDoDiscord(commands.Cog, name="ToDo"):
|
||||||
"""Commandes relatives aux To Do."""
|
"""Commandes relatives aux To Do."""
|
||||||
def __init__(self, client):
|
def __init__(self, client):
|
||||||
self.client = client
|
self.client = client
|
||||||
|
ToDo().creationTable()
|
||||||
|
|
||||||
@commands.command(name='todo')
|
@commands.command(name='todo')
|
||||||
async def _todo(self, ctx, *todo):
|
async def _todo(self, ctx, *todo):
|
||||||
|
@ -28,6 +29,8 @@ class ToDoDiscord(commands.Cog, name="ToDo"):
|
||||||
else:
|
else:
|
||||||
now = int(nowUTC())
|
now = int(nowUTC())
|
||||||
messageID = None
|
messageID = None
|
||||||
|
if len(todo) > 1024:
|
||||||
|
return await mySendHidden(ctx, fromSlash, "Message trop long (maximum de 1024 caractères).")
|
||||||
if fromSlash != True:
|
if fromSlash != True:
|
||||||
messageID = ctx.message.id
|
messageID = ctx.message.id
|
||||||
todoID = ToDo().ajout(messageID, todo, now, ctx.author.id)
|
todoID = ToDo().ajout(messageID, todo, now, ctx.author.id)
|
||||||
|
|
|
@ -4,8 +4,6 @@ import discord
|
||||||
from os import listdir, rename, getcwd
|
from os import listdir, rename, getcwd
|
||||||
from discord_slash import SlashCommand
|
from discord_slash import SlashCommand
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from utils.reminder import Reminder
|
|
||||||
from utils.todo import ToDo
|
|
||||||
from utils.core import load, addReaction
|
from utils.core import load, addReaction
|
||||||
from utils.page import listReaction
|
from utils.page import listReaction
|
||||||
keys = load(["PREFIX", "TOKEN_DISCORD", "DEACTIVATE"])
|
keys = load(["PREFIX", "TOKEN_DISCORD", "DEACTIVATE"])
|
||||||
|
@ -49,8 +47,6 @@ async def on_resumed():
|
||||||
async def on_ready():
|
async def on_ready():
|
||||||
"""Triggered when the bot is ready to operate"""
|
"""Triggered when the bot is ready to operate"""
|
||||||
await client.change_presence(status = discord.Status.online, activity = discord.Activity(name = f"{customPrefix}help", type = discord.ActivityType.playing))
|
await client.change_presence(status = discord.Status.online, activity = discord.Activity(name = f"{customPrefix}help", type = discord.ActivityType.playing))
|
||||||
Reminder().creationTable()
|
|
||||||
ToDo().creationTable()
|
|
||||||
print("Bot prêt.")
|
print("Bot prêt.")
|
||||||
|
|
||||||
@client.event
|
@client.event
|
||||||
|
|
Reference in a new issue