Python Discord Bot

import discord
import os

my_token = os.environ['token']

client = discord.Client(intents=discord.Intents.default())

async def on_ready():
  print("WE HAVE LOGGED IN AS {0.user}".format(client))

async def on_message(message):
  if == client.user:
  if message.content.startswith('$hello'):

The bot only responds to the ‘$hello’ command when it’s a direct message, but when I try on my server nothing happens.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.