@commands.command(aliases = ["pin"])
@commands.cooldown(1, 60, commands.BucketType.user)
async def ping(self, ctx):
await ctx.channel.purge(limit = 1)
emb = discord.Embed (title = 'Пинг: {0} ms'.format(client.latency * 1000), colour = discord.Color.gold())
await ctx.send(embed = emb,delete_after=30)
You must have the manage_messages permission to delete messages even if they are your own (unless you are a user account). The read_message_history permission is also needed to retrieve message history.
@commands.command(aliases = ["pin"])
@commands.cooldown(1, 60, commands.BucketType.user)
async def ping(self, ctx):
await ctx.channel.purge(limit = 1)
emb = discord.Embed (title = 'Пинг: {0} ms'.format(client.latency * 1000), colour = discord.Color.gold())
await ctx.send(embed = emb,delete_after=30)