
[英]I am making relationships from a dictionary, but can someone help me fix one output I can't figure out?
[英]When I have two different embed commands with different urls only one of them will work- Can someone help figure this out for me?
@client.event async def on_message(message): if message.content.startswith('!axb'): embed = discord.Embed(title="Axb :sparkles:", description="9b9t Bot Dev", color=0xf188c9) embed.set_image(url='insert url') await message.channel.send(embed=embed) @client.event async def on_message(message): if message.content.startswith('!opal'): embed = discord.Embed(title="opal :sparkles:", description="9b9t Bot Dev", color=0xf188c9) embed.set_image(url='insert url') await message.channel.send(embed=embed)
只有最后一个on_message
事件会起作用,为什么不使用简单的 elif 语句呢?
@client.event
async def on_message(message):
if message.content.startswith('!axb'):
embed = discord.Embed(title="Axb :sparkles:", description="9b9t Bot Dev", color=0xf188c9)
embed.set_image(url='insert url')
await message.channel.send(embed=embed)
elif message.content.startswith('!opal'):
embed = discord.Embed(title="opal :sparkles:", description="9b9t Bot Dev", color=0xf188c9)
embed.set_image(url='insert url')
await message.channel.send(embed=embed)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.