I´d like to know how to register my command so it will be visible in text-line when you write, so the whisperer whispers command help This is my code:
import discord
from discord.ext import commands
import random
import nest_asyncio
nest_asyncio.apply()
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.event
async def on_ready():
print(f'Logged in as {bot.user} (ID: {bot.user.id})')
print('------')
@bot.command()
async def randomnumber(ctx, howmuch):
x = 0
if howmuch >= "5":
await ctx.send("Are you kidding!?")
else:
while str(x) < howmuch:
x += 1
await ctx.send(random.random())
@bot.command()
async def purge(ctx):
print("Command disabled.")
@bot.command()
async def cookie(ctx):
await ctx.send("Cookies!")
cookie = discord.File("cookie.jpg")
await ctx.send(file = cookie)
print("Cookies!")
bot.run("My bot token")
I thought it is enough, but I found out it is not. Please help and sorry for my english. Thank you.