我得到的数据如下 on_message()
活动:
<Message id=863340082848596027 channel=<TextChannel id=xx name='👉🏻beginners' position=22 nsfw=False news=False category_id=xx> type=<MessageType.default: 0> author=<Member id=xx name='Stormwing' discriminator='3997' bot=False nick=None guild=<Guild id=xx name='r/CryptoCurrency' shard_id=None chunked=False member_count=58816>> flags=<MessageFlags value=0>>
这个 message.content
返回空
我只想从某个频道获取消息。代码如下:
if __name__ == '__main__':
channel_id = 'xxx'
print(USER_TOKEN)
bot = commands.Bot(">>>", self_bot=True)
@bot.event
async def on_ready():
print(f'Bot connected as {bot.user}')
# for guild in bot.guilds:
# for channel in guild.text_channels:
# print(channel.id,channel)
@bot.event
async def on_message(message):
print(message)
# bot.run(USER_TOKEN, bot=False)
print('Run')
bot.run(USER_TOKEN, bot=False)
暂无答案!
目前还没有任何答案,快来回答吧!