Python 当我有两个具有不同URL的不同嵌入命令时,其中只有一个可以工作-有人能帮我解决这个问题吗? @client.event 异步def on_消息(消息): 如果message.content.startswith(“!axb”): 嵌入=discord.embed(title=“Axb:sparkles:”,description=“9b9t Bot Dev”,color=0xf188c9) 嵌入.set_图像(url='insert url') 等待message.channel.send(嵌入=嵌入) @客户端事件 异步def on_消息(消息): 如果message.content.startswith(“!opal”): 嵌入=discord.embed(title=“opal:sparks:”,description=“9b9t Bot Dev”,color=0xf188c9) 嵌入.set_图像(url='insert url') 等待message.channel.send(嵌入=嵌入)
只有最后一条消息上的Python 当我有两个具有不同URL的不同嵌入命令时,其中只有一个可以工作-有人能帮我解决这个问题吗? @client.event 异步def on_消息(消息): 如果message.content.startswith(“!axb”): 嵌入=discord.embed(title=“Axb:sparkles:”,description=“9b9t Bot Dev”,color=0xf188c9) 嵌入.set_图像(url='insert url') 等待message.channel.send(嵌入=嵌入) @客户端事件 异步def on_消息(消息): 如果message.content.startswith(“!opal”): 嵌入=discord.embed(title=“opal:sparks:”,description=“9b9t Bot Dev”,color=0xf188c9) 嵌入.set_图像(url='insert url') 等待message.channel.send(嵌入=嵌入),python,discord,discord.py,Python,Discord,Discord.py,只有最后一条消息上的事件才会起作用,为什么不使用简单的elif语句呢 @client.event 异步def on_消息(消息): 如果message.content.startswith(“!axb”): 嵌入=discord.embed(title=“Axb:sparkles:”,description=“9b9t Bot Dev”,color=0xf188c9) 嵌入.set_图像(url='insert url') 等待message.channel.send(嵌入=嵌入) elif m
事件才会起作用,为什么不使用简单的elif语句呢
@client.event
异步def on_消息(消息):
如果message.content.startswith(“!axb”):
嵌入=discord.embed(title=“Axb:sparkles:”,description=“9b9t Bot Dev”,color=0xf188c9)
嵌入.set_图像(url='insert url')
等待message.channel.send(嵌入=嵌入)
elif message.content.startswith(“!opal”):
嵌入=discord.embed(title=“opal:sparks:”,description=“9b9t Bot Dev”,color=0xf188c9)
嵌入.set_图像(url='insert url')
等待message.channel.send(嵌入=嵌入)