bot not responding to commands #9321
Replies: 3 comments 4 replies
-
Don't know for sure, but you reset intents to default right after enabling message content, which doesn't look correct. |
Beta Was this translation helpful? Give feedback.
2 replies
-
import discord
from discord.ext import commands
intents = discord.Intents.default()
intents.message_content = True
client = commands.Bot(command_prefix='.', intents=intents)
@client.event
async def on_ready():
await client.change_presence(status=discord.Status.online, activity=discord.Game('testing'))
print('Bot is ready.')
@client.command()
async def hi(ctx):
await ctx.send('Hello!')
client.run('token') |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Kohlla
-
boyyyy😭😭😭😭 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
created the simplest discord bot
there was a problem, the bot only responds to commands in private messages, on the server it does not react at all
changed rights issued roles, 0 reactions
used this code
**import discord
from discord.ext import commands
intents = discord.Intents.default()
intents.message_content = True
intents = discord.Intents.default()
client = commands.Bot(command_prefix='.', intents=intents)
@client.event
async def on_ready():
await client.change_presence(status=discord.Status.online, activity=discord.Game('testing'))
print('Bot is ready.')
@client.command()
async def hi(ctx):
await ctx.send('Hello!')
client.run('token')**
Beta Was this translation helpful? Give feedback.
All reactions