【发布时间】:2021-12-20 09:20:54
【问题描述】:
我遇到一个问题,当我在 Discord.py 上制作多个 Embed 时,第一个命令没有响应,但第二个命令响应。
这是我的代码:
import discord
from discord.ext import commands
client = commands.Bot(command_prefix = '.')
@client.event
async def on_ready():
await client.change_presence(status=discord.Status.online, activity=discord.Game('private'))
print('bot is online')
@client.event
async def on_message(message):
if message.content.startswith('.kade'):
embedVar = discord.Embed(title="Kade Engine Download", description="Downloads for Kade Engine 1.8", color=0x2C93FA)
embedVar.add_field(name="Kade Engine Installation", value="https://github.com/KadeDev/Kade-Engine/releases/tag/1.8", inline=False)
embedVar.add_field(name="Kade Engine Source (Recommended for Mod Makers)", value="https://github.com/KadeDev/Kade-Engine", inline=False)
await message.channel.send(embed=embedVar)
@client.event
async def on_message(message):
if message.content.startswith('.week'):
embedVar = discord.Embed(title="How to make a week", description="How to make a week", color=0x2C93FA)
embedVar.add_field(name="test", value="test", inline=False)
embedVar.add_field(name="test", value="test", inline=False)
await message.channel.send(embed=embedVar)
client.run('WONT SHOW BOT TOKEN')
有人可以帮我解决这个问题吗?
【问题讨论】:
标签: python python-3.x discord discord.py