Python TypeError: 'set' object is not callable

Katılım
24 Kasım 2022
Mesajlar
20
Reaksiyon skoru
1
Selam, python dilinde discord için bot yaparken
TypeError: 'set' object is not callable
adlı hatayı aldım
hatayı aldığım yer
@Bot.commands(name='test')
async def test(ctx):
await ctx.send("Hello")
bana burada hata aldığımı söylüyor kontrol ediyorum ama hatayı bulamıyorum
tam olarak ne yapmam gerek.

Kodun tamamı
import discord
from discord.ext import commands
set[discord.ext.commands.Command]

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

Bot = commands.Bot(command_prefix="m!", intents=intents)

@Bot.event
async def on_ready():
print("Ready!")

@Bot.commands(name='test')
async def test(ctx):
await ctx.send("Hello")

Bot.run('MTA1NjI0MDQ1MjI4Nzg3NzIxMA.GOJaqx.j21ls_pJyKu4OPN5B4pRkIm83uCdTRiSvfAr4k')
 
Selam, python dilinde discord için bot yaparken
TypeError: 'set' object is not callable
adlı hatayı aldım
hatayı aldığım yer
@Bot.commands(name='test')
async def test(ctx):
await ctx.send("Hello")
bana burada hata aldığımı söylüyor kontrol ediyorum ama hatayı bulamıyorum
tam olarak ne yapmam gerek.

Kodun tamamı
import discord
from discord.ext import commands
set[discord.ext.commands.Command]

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

Bot = commands.Bot(command_prefix="m!", intents=intents)

@Bot.event
async def on_ready():
print("Ready!")

@Bot.commands(name='test')
async def test(ctx):
await ctx.send("Hello")

Bot.run('MTA1NjI0MDQ1MjI4Nzg3NzIxMA.GOJaqx.j21ls_pJyKu4OPN5B4pRkIm83uCdTRiSvfAr4k')

set[discord.ext.commands.Command] bu kısımda hata.
set objesi çağrılamaz diyor. buradaki kullanımınız muhtemelen yanlış bir değişkeni ya da sınıfı ya da fonksiyonu farkında olmadan bir array gibi kullanmaya çalışmışsınız.
 
Geri
Top