1
0

main.py 761 B

1234567891011121314151617181920212223
  1. import discord
  2. from today import today
  3. # Creating a client instance
  4. intents = discord.Intents.default()
  5. intents.message_content = True
  6. client = discord.Client(intents=intents)
  7. @client.event
  8. async def on_ready(): # Print a message when the bot turns on
  9. print(f'We have logged in as {client.user}')
  10. @client.event
  11. async def on_message(message):
  12. if message.author == client.user: # Check if the message was sens by the bot
  13. return
  14. if message.content.startswith("edt?"): # Check if the message starts with 'edt', which is the command we defined to view the timetable.
  15. await message.channel.send(today())
  16. client.run("PUT YOUR TOKEN HERE")