Hello there! I’m new to creating and developing Discord bots. and I created a simple script:
import discord
import os
client = discord.Client(intents=discord.Intents.default())
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('$hello'):
await message.channel.send('Hello!')
client.run(os.getenv('Token'))
And when I run it in console, it doesn’t give me any errors, and it says that it’s running, and Discord says that my bot is online.
Thank you for reading.