Since Pycord is kind of a Discord.py fork, i thought i could just use ctx.purge(limit=X), but it does'nt work. Can anyone help me?
This is my code:
@bot.command()
async def purge(ctx, amount: int):
await ctx.purge(limit=amount)
await ctx.respond(f"Purged {amount} messages.")
It is a fork of discord.py so it will carry over a lot of its attributes and methods.
discord.Interactionhas an attribute for the message and using the message attribute we can retrieve the channel:https://docs.pycord.dev/en/stable/api/models.html#discord.Interaction.message
Purge is an function of discord.TextChannel read more here
If this doesn't work you can print
messagevariable and see the attributes it has.