diff --git a/src/events/school_time/discord_bot.py b/src/events/school_time/discord_bot.py index c3fdf6b..4a03153 100644 --- a/src/events/school_time/discord_bot.py +++ b/src/events/school_time/discord_bot.py @@ -24,6 +24,7 @@ async def on_ready(): print('We have logged in as {0.user}'.format(bot)) bot.loop.create_task(orario()) +# Search on MongoDB the subject and send a message on Discord if the subject is found @tasks.loop(seconds=1) async def orario(): documents = collection.find() @@ -37,4 +38,8 @@ async def orario(): channel = bot.get_channel(1063753802638954519) await channel.send(f"Day: {day}, Hour school: {i}, Subject found: {subject['Subject']} at index: {i}") +@bot.slash_command(name="first_slash", guild_ids=['1063753799874912337']) #Add the guild ids in which the slash command will appear. If it should be in all, remove the argument, but note that it will take some time (up to an hour) to register the command if it's for all guilds. +async def first_slash(ctx): + await ctx.respond("You executed the slash command!") + bot.run(DISCORD_TOKEN) \ No newline at end of file