#🔒 can't run the bot

21 messages · Page 1 of 1 (latest)

gusty shell
#

When i try to run the bot it won't work i don't know why it gives me so many errors in lines that don't even exist.

near crestBOT
#

@gusty shell

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

gusty shell
#

it gives me all this error Traceback (most recent call last):
File "c:\Users\db\Documents\Cylo.py", line 189, in <module>
@bot.command()
^^^^^^^^^^^^^
File "C:\Users\db\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\ext\commands\core.py", line 1521, in decorator
self.add_command(result)
File "C:\Users\db\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\ext\commands\bot.py", line 253, in add_command
super().add_command(command)
File "C:\Users\db\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\ext\commands\core.py", line 1356, in add_command
raise CommandRegistrationError(command.name)
discord.ext.commands.errors.CommandRegistrationError: The command effacer is already an existing command or alias.

pine ether
#

need the code

gusty shell
#

Ok wait

#

how can i put the code

near crestBOT
#

Hey @gusty shell!

It looks like you're trying to paste code into this channel.

Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.

To do this, use the following method:
```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
You can **edit your original message** to correct your code block.
pine ether
#
import discord
from discord.ext import commands
import random
import requests
import asyncio

intents = discord.Intents.default()
intents.message_content = True

client = discord.Client(intents=intents)

bot = commands.Bot(command_prefix=".", intents=intents)

@bot.event
async def on_ready():
    print(f'Bot connecté comme {bot.user}')

@bot.command()
async def salut(ctx):
    await ctx.send(f"Salut, {ctx.author.mention} ! ")

@bot.command()
async def piece(ctx):
    resultat = random.choice(["Pile", "Face"])
    await ctx.send(f"La pièce est tombée sur : {resultat}")

@bot.command()
async def de(ctx):
    resultat = random.randint(1, 6)
    await ctx.send(f"Vous avez lancé un dé et obtenu : {resultat}")```
gusty shell
#

that's not the whole code

#

wait

#
import discord
from discord.ext import commands
import random
import requests
import asyncio

intents = discord.Intents.default()
intents.message_content = True

client = discord.Client(intents=intents)

bot = commands.Bot(command_prefix=".", intents=intents)

@bot.event
async def on_ready():
    print(f'Bot connecté comme {bot.user}')

@bot.command()
async def salut(ctx):
    await ctx.send(f"Salut, {ctx.author.mention} ! 👋")

@bot.command()
async def piece(ctx):
    resultat = random.choice(["Pile", "Face"])
    await ctx.send(f"La pièce est tombée sur : {resultat}")

@bot.command()
async def de(ctx):
    resultat = random.randint(1, 6)
    await ctx.send(f"Vous avez lancé un dé et obtenu : {resultat}")

@bot.command()
async def rappel(ctx, temps: int, *, tache):
    await ctx.send(f"Je te rappellerai: '{tache}' dans {temps} secondes.")
    await asyncio.sleep(temps)    await ctx.author.send(f"Rappel: {tache}")

@bot.command()
async def raccourcir(ctx, url):
    try:
        api_url = f"http://is.gd/create.php?format=simple&url={url}"
        short_link = requests.get(api_url).text
        await ctx.send(f"Le lien raccourci: {short_link}")
    except:
        await ctx.send("Erreur lors de la génération du lien raccourci.")
#

I have more things in the code but like i don't have space

#

to put here

pine ether
#

paste your code there and put your link in this chat

gusty shell
#

.close

#

?close

minor briarBOT
#

This is not a Modmail thread.

near crestBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.