Skip to content Skip to sidebar Skip to footer

Discord Command Bot Doesn't Responde (python)

i have a problem with my discord bot: when i type on discord $ping he doesn't response me pong and i don't know why, i just check the bot have the admin role so he can write, i'm u

Solution 1:

The problem is, that you are defining the command with bot.command, but you only do client.run. To fix this, either choose a client, or a bot, but not both, like this if you choose bot for example:

import discord
from discord.ext import commands
import json
import random

bot = commands.Bot(command_prefix='$')

@bot.command()asyncdefping(ctx):
    await ctx.channel.send("pong")

@bot.eventasyncdefon_ready():
    print('We have logged in as {0.user}'.format(bot))
    
bot.run(Token)

Also don't use requests, since it's blocking.

Post a Comment for "Discord Command Bot Doesn't Responde (python)"