Home > other >  My discord bot is online but doesn't interact
My discord bot is online but doesn't interact

Time:02-04

I came back to creating bots on discord, but this time with Python, it seems I am doing something wrong, and I don't know what it is.

I placed a simple code, which is (command-reply), but the bot does not answer and does nothing about it.

My bot is online, I don't get errors in my terminal, and I am using the correct token.

Here is my code:

import discord

intents = discord.Intents.default()
intents.members = True

client = discord.Client(intents=intents)

@client.event
async def on_message(message):
    if message.content == "hello":
        await message.channel.send("Hello there!")

client.run('BOT TOKEN')

CodePudding user response:

You didn't enable the message_content intent.

Docs about intents: https://discordpy.readthedocs.io/en/stable/intents.html

  • Related