【发布时间】:2021-09-29 16:04:51
【问题描述】:
我想编辑 on_ready 事件中的嵌入,这是我可以编辑的唯一方法可以执行 on_message 还是有办法让函数保持运行直到程序结束?
from discord.ext import commands
import discord
from discord.utils import get
@bot.event
async def on_ready():
msg = bot.get_message(892788147287654471)
em = discord.Embed(title="lik",description="kjk")
await msg.edit(embed=em)
bot.run(os.environ['token'])
错误代码:
Ignoring exception in on_ready
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "main.py", line 56, in on_ready
msg = bot.get_message(892788147287654471)
AttributeError: 'Bot' object has no attribute 'get_message'
【问题讨论】:
标签: python-3.x discord.py