#coucou c'est fives # wesh wesh ici latouff import discord # pip install pycord import asyncio # pip install asyncio import cogs # import the cogs import datetime # pip install datetime from config import debug, conn, c # import the debug function and the database connection intents = discord.Intents.default() intents.message_content = True intents.members = True bot = discord.Bot(intents=intents, help_command=None) # create the bot bot.add_cog(cogs.Setup(bot)) bot.add_cog(cogs.Settings(bot)) bot.add_cog(cogs.Help(bot)) bot.add_cog(cogs.Chat(bot)) bot.add_cog(cogs.ManageChat(bot)) @bot.event async def on_ready(): await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="your messages to answer you")) debug("Bot is ready") ''' def reset_uses_count_today(): c.execute("UPDATE data SET uses_count_today = 0") conn.commit() #get the current date and save it in the previous_date variable #if the day number is different from the previous day number, reset the uses count today def check_day(): global previous_date if datetime.datetime.now().day != previous_date.day: previous_date = datetime.datetime.now() previous_date = datetime.datetime.now() return True else: previous_date = datetime.datetime.now() return False #run check_day every 10 seconds async def check_day_task(): while True: check_day() await asyncio.sleep(60) #add a task to the bot that runs check_day every 1 minute bot.loop.create_task(check_day_task()) ''' #run the bot # Replace the following with your bot's token with open("./key.txt") as f: key = f.read() bot.run(key)