0
votes

I am not sure why the commands don't work. Whenever I enter !hello into my discord server the bot doesnt respond.

import discord
from discord.ext import commands
import os

my_secret = os.environ['Token']
client = commands.Bot(command_prefix='!')

@client.command(pass_context=True)
async def hello(ctx):
  await ctx.send("Hello")


client.run(my_secret)
1

1 Answers

0
votes

This should Work I just tested it and it worked fine did you install Discord? and did you wrote your Token right?

Also you should put this Code in yours so you see when the Bot is ready

@client.event
async def on_ready():
print(" ")
print("Bot started! | Informations:")
print(f"- Name: {client.user.name}") 
print(f"- Bot-ID: {client.user.id}") 
print(f"- Server using {client.user.name}:",
      len(client.guilds))