检查我的机器人发送的已存储嵌入列表中是否已经存在一个嵌入

时间:2020-09-24 11:38:48

标签: python discord.py discord.py-rewrite

我是编程的新手,并创建了一个discord机器人,该机器人可以将用户嵌入的“报价”存储在列表中。问题是我不想存储这些引号的重复项。 我不确定如何检查嵌入是否已在我的em_list中,因为每个嵌入都是唯一的,即使其中的内容是重复的也是如此。请帮助:((

@client.command(aliases=['save'],brief='quote a user')
async def quote(ctx,user:discord.Member,*,message):
    color=discord.Color(value=0x9C2A00)
    async for messages in ctx.channel.history(limit=1):
        pass
    em=discord.Embed(color=color,title=message,description=f'-{user}, [original](https://discordapp.com/channels/{messages.guild.id}/{messages.channel.id}/{messages.id})')
    await ctx.send(em_list)
    em_list.append(em)



@client.command(aliases=['getsaves','getquotes'],brief='gets last quote/unfinished command')
async def getquote(ctx):
     for quote in em_list:
         await ctx.send(embed=quote)

0 个答案:

没有答案
相关问题