2 回答
TA贡献1803条经验 获得超6个赞
这是工作代码:
# This sends an embed message with a description of the roles.
@client.event
async def on_message(message):
if message.channel.id == 700895165665247325:
if message.content.startswith('roles'):
embedvar = discord.Embed(title="React to this message to get your roles!",
description="Click the corresponding emoji to receive your role.\n<:WarThunder:"
"745425772944162907> - War Thunder\n<:Apex:745425965764575312> - "
"Apex\n<:ModernWarfare:757104623738814554> - "
"Modern Warfare\n<:Minecraft:757029546632413346> - "
"Minecraft\n<:R6Siege:757030019909550122> - R6 Siege", color=0x00ff00)
await message.channel.send(embed=embedvar)
print("Changed message embed color.")
elif message.content.startswith('update'):
embedvar2 = discord.Embed(title="React to this message to get your roles!",
description="Click the corresponding emoji to receive your role.\n<:WarThunder:"
"745425772944162907> - War Thunder\n<:Apex:745425965764575312> - "
"Apex\n<:ModernWarfare:757104623738814554> - "
"Modern Warfare\n<:Minecraft:757029546632413346> - "
"Minecraft\n<:R6Siege:757030019909550122> - R6 Siege\n"
"<:AmongUs:760192601625591859> - Among Us", color=0x00ff00)
channel = client.get_channel(700895165665247325)
msg = await channel.fetch_message(757114312413151272)
await msg.edit(embed=embedvar2)
print("Updated role reaction message.")
else:
return
我只需在正确的频道中输入“更新”,其中的内容embedvar2就是消息更新的内容。
TA贡献1813条经验 获得超2个赞
您正在尝试编辑message
事件传递的内容,请尝试:
msg = await message.channel.send(embed=embedvar) await msg.edit(embed=embedvar2)
添加回答
举报