Erreur dans mon bot Discord avec Python
Tomy63A
-
khrug -
khrug -
Bonjour,
j'ai crée un bot discord en python
voici son code:
quand je le lance tout va bien et sur mon serveur je peux faire ?help
mais quand je veux executer ?hello, ça me met :
savez vous ce qui ne marche pas ?
Si oui merci d'avance.
j'ai crée un bot discord en python
voici son code:
import discord
from discord.ext import commands
TOKEN = 'Je vais quand même pas vous dire le Token de mon bot xD'
description = '''Bot Python'''
bot = commands.Bot(command_prefix='?', description=description)
@bot.event
async def on_ready():
print('Logged in as')
print(bot.user.name)
print(bot.user.id)
print('------')
@bot.command()
async def hello():
"""Says Hello World"""
await bot.say("Hellod")
bot.run(TOKEN)
quand je le lance tout va bien et sur mon serveur je peux faire ?help
mais quand je veux executer ?hello, ça me met :
Traceback (most recent call last):
File "C:\Users\tomba\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\client.py", line 270, in _run_event
await coro(*args, **kwargs)
File "C:\Users\tomba\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\ext\commands\bot.py", line 901, in on_message
await self.process_commands(message)
File "C:\Users\tomba\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\ext\commands\bot.py", line 898, in process_commands
await self.invoke(ctx)
File "C:\Users\tomba\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\ext\commands\bot.py", line 863, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\tomba\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\ext\commands\core.py", line 721, in invoke
await self.prepare(ctx)
File "C:\Users\tomba\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\ext\commands\core.py", line 685, in prepare
await self._parse_arguments(ctx)
File "C:\Users\tomba\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\ext\commands\core.py", line 595, in _parse_arguments
raise discord.ClientException(fmt.format(self))
discord.errors.ClientException: Callback for hello command is missing "ctx" parameter.
savez vous ce qui ne marche pas ?
Si oui merci d'avance.
A voir également:
- Erreur dans mon bot Discord avec Python
- Citizen code python - Accueil - Outils
- Compte discord - Guide
- Discord ne se lance pas ✓ - Forum Discord
- Discord ecran noir - Forum Discord
- Discord ne se lance pas - Ecran noir. - Forum Logiciels
A command must always have at least one parameter, ctx, which is the Context as the first one.
C'est quand même de l'anglais assez simple à comprendre.
Et puis y a des exemples sur cette page.