Python 如何通过ID获取消息?
我试图通过机器人发送给我的ID获取消息,之后我想对此消息添加一个反应,但我试图通过Python 如何通过ID获取消息?,python,discord,discord.py,Python,Discord,Discord.py,我试图通过机器人发送给我的ID获取消息,之后我想对此消息添加一个反应,但我试图通过fetch\u message和get\u message获取消息,但没有人工作。我总是遇到此错误模块“discord.client”没有属性“get_message”,对象实现了Messageable协议 实现了该方法 所以使用 message=wait channelsnipe.fetch_消息(idbot) 试试看 message=wait channelsnipe.fetch_消息(idbot) 属性错误:
fetch\u message
和get\u message
获取消息,但没有人工作。我总是遇到此错误模块“discord.client”没有属性“get_message”
,对象实现了Messageable
协议
实现了该方法
所以使用
message=wait channelsnipe.fetch_消息(idbot)
试试看
message=wait channelsnipe.fetch_消息(idbot)
属性错误:模块'discord.client'没有属性'get_message'
:它不工作:cWhat版本的discord.py
正在运行?我在回答中输入了一个错误:D。它应该是fetch_message我得到了这个:discord.errors.Forbidden:403 Forbidden(错误代码:20002):只有机器人程序可以使用此端点
您如何进行身份验证?使用Bot令牌或OAuth2?其不工作==>discord.errors.Forbidden:403禁止(错误代码:20002):只有Bot可以使用此端点
bot=discord.Client()
@bot.event
async def on_message(ctx):
idbot = 835947059721797702
if ctx.author.id == idbot:
print(ctx.content)
channelsnipe = bot.get_channel(833472112290168842)
id = await client.get_message(channelsnipe,idbot)
#await asyncio.sleep(0.2) # Give time for reaction to update on cache
#reaction = id.reactions[0] # Get first reaction of a message
#emoji = reaction.emoji
#await id.add_reaction(emoji)