Discord için yazılan botta bir hata var (discord.py)

Katılım
12 Kasım 2020
Mesajlar
3
Reaksiyon skoru
0
Python:
import discord
from discord.ext import commands
class MyClient(discord.Client):
    async def on_ready(self):
        print(f'{self.user} Giris yapti!')
    async def on_message(self, message):
        print(f'{message.author} Adli kisiden mesaj var: {message.content}')
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.command()
async def test(ctx, arg):
    await ctx.send(arg)
bot.add_command(test)
client = MyClient(intents=intents)
client.run('token')

Bu kodda aşağıdaki şekilde bir hata alıyorum:

Kod:
Traceback (most recent call last):
  File "c:\Users\kaank\Desktop\kozmos.py\main.py", line 20, in <module>
    bot.add_command(test)
    ~~~~~~~~~~~~~~~^^^^^^
  File "C:\Users\kaank\AppData\Local\Programs\Python\Python313\Lib\site-packages\discord\ext\commands\bot.py", line 253, in add_command
    super().add_command(command)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "C:\Users\kaank\AppData\Local\Programs\Python\Python313\Lib\site-packages\discord\ext\c
ommands\core.py", line 1356, in add_command
    raise CommandRegistrationError(command.name)
discord.ext.commands.errors.CommandRegistrationError: The command test is already an existing command or alias.

Yardım edebilirmisiniz?
 
Python:
import discord
from discord.ext import commands
class MyClient(discord.Client):
    async def on_ready(self):
        print(f'{self.user} Giris yapti!')
    async def on_message(self, message):
        print(f'{message.author} Adli kisiden mesaj var: {message.content}')
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.command()
async def test(ctx, arg):
    await ctx.send(arg)
bot.add_command(test)
client = MyClient(intents=intents)
client.run('token')

Bu kodda aşağıdaki şekilde bir hata alıyorum:

Kod:
Traceback (most recent call last):
  File "c:\Users\kaank\Desktop\kozmos.py\main.py", line 20, in <module>
    bot.add_command(test)
    ~~~~~~~~~~~~~~~^^^^^^
  File "C:\Users\kaank\AppData\Local\Programs\Python\Python313\Lib\site-packages\discord\ext\commands\bot.py", line 253, in add_command
    super().add_command(command)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "C:\Users\kaank\AppData\Local\Programs\Python\Python313\Lib\site-packages\discord\ext\c
ommands\core.py", line 1356, in add_command
    raise CommandRegistrationError(command.name)
discord.ext.commands.errors.CommandRegistrationError: The command test is already an existing command or alias.

Yardım edebilirmisiniz?
'token' kismini doldurdunuz mu?
Mesajlar otomatik olarak birleştirildi:

'token' kismini doldurdunuz mu?
+ olarak websiteden intentler acildi mi?
 
'token' kismini doldurdunuz mu?
Mesajlar otomatik olarak birleştirildi:


+ olarak websiteden intentler acildi mi?
token kısmı dolu cevap verme komudunu eklemeden önce yazdığım mesajı terminalde gösteriyordu yani aktif oluyordu bot + olarak intent nedir bilmiyorum :(
 
Yeni mesajlar Yeni Konu Aç  

   

SON KONULAR

Forum istatistikleri

Konular
1,172,567
Mesajlar
10,568,598
Üyeler
186,210
Son üye
niroieth
Geri
Top