【发布时间】:2019-08-15 05:16:03
【问题描述】:
我需要找到该机器人之前发布的消息,然后查看其上的反应。我认为我没有正确使用:discord.utils.find()。
我环顾四周,但找不到任何关于 Discord.py 的东西,我能找到的所有东西都是关于 Discord.js 的。
这是我的代码:
import discord
TOKEN = '[I have a token here]'
client = discord.Client()
m_id = 0
@client.event
async def on_message(message):
if message.author == client.user:
global m_id
m_id = message.id
if not message.author == client.user:
if message.content.startswith('!poll'):
msg = 'Test poll \nMessage ID: {0.id}'.format(message)
await client.send_message(message.channel, msg)
if message.content.startswith('!endpoll'):
new_message = discord.utils.find(lambda m: m.id(m_id), client.messages)
print(new_message.reactions)
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
client.run(TOKEN)
我需要我的机器人打印一份对其初始消息的反应列表。
【问题讨论】:
标签: python-3.x discord.py