Discord'dan bot yazıyordum mesaj silme kodu hata veriyor.
Neyi yanlış yapıyor olabilirim? Str yerine int de yazdım. str(int şeklinde de yazdım hiçbir şekilde olmadı.
Ignoring exception in command sil:
Traceback (most recent call last):
File "C:\Users\Arda\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\Arda\Desktop\Bot btw\kurti\kurti.py", line 52, in sil
await ctx.channel.purge(limit=str(amount+1))
TypeError: can only concatenate str (not "int") to str
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Arda\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\Arda\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\Arda\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: can only concatenate str (not "int") to str
Traceback (most recent call last):
File "C:\Users\Arda\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\Arda\Desktop\Bot btw\kurti\kurti.py", line 52, in sil
await ctx.channel.purge(limit=str(amount+1))
TypeError: can only concatenate str (not "int") to str
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Arda\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\Arda\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\Arda\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: can only concatenate str (not "int") to str
@client.command()
@commands.has_permissions(manage_messages=True)
async def sil(ctx, amount):
await ctx.channel.purge(limit=str(amount+1))
await ctx.send(f'**{amount}** tane mesaj uzaya yollandı ', delete_after=5)
@commands.has_permissions(manage_messages=True)
async def sil(ctx, amount):
await ctx.channel.purge(limit=str(amount+1))
await ctx.send(f'**{amount}** tane mesaj uzaya yollandı ', delete_after=5)
Neyi yanlış yapıyor olabilirim? Str yerine int de yazdım. str(int şeklinde de yazdım hiçbir şekilde olmadı.