I am making a discord bot that I can send the day and lesson number then it prints out the lesson. I am planning on making it reply with simple if statements. It replies to some of the if statements but not the rest.
import discord
import discord.client
import random
TOKEN = *************************************************
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
@client.event
async def on_ready():
print("Logged as {0.user}".format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.lower().startswith("hello"):
await message.channel.send(f'Hello, {message.author.display_name}!')
return
elif message.content.lower().startswith("S1"):
await message.channel.send(f'Arabic')
return
client.run(TOKEN)
- Am I going the right way about creating the bot?
- If not, what and how should I go about creating it?
- What has gone wrong?
- How do I fix it? Messages Replied and aired