@bot.command(name="clear", alliases=["purge"])
@commands.has_permissions(manage_messages=True)
async def clear_messages(self, ctx, limit: typing.Optional[int] = 1):
if 0 < limit <= 100:
with ctx.channel.typing():
await ctx.channel.purge(limit = limit)
await ctx.message.delete()
I'm having issues with this code block specifically, where I get an error that 'str' has no attribut 'channel'. In other parts of my code (shown below) there is a similar idea, but the command passes. Any help is greatly appreciated.
@bot.command()
async def say(ctx, *args):
await ctx.send('{}'.format(' '.join(args)))
await ctx.message.delete()
selfarg.ctxis a parameter, so whatever is calling this function is passing a string.