Im making a discord bot, but my bot is only responding in DM and not in my server.
this is my code, cxan someone help me to get me discord bot to respond in my server.
import discord
import os
from dotenv import load_dotenv
from discord.ext.commands import Bot
from discord.ext import commands
TOKEN='TOKEN'
load_dotenv()
TOKEN = os.getenv('TOKEN')
intents = discord.Intents.default()
client = discord.Client(intents=intents)
@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('TOKEN')