【问题标题】:Read Discord channel messages with a bot使用机器人阅读 Discord 频道消息
【发布时间】:2021-02-07 00:11:34
【问题描述】:

我正在开发一个 python 机器人来读取我在我的帐户中收到的所有传入消息。代码很简单:

import discord

client = discord.Client()

@client.event
async def on_ready():
    print('We have logged in as {0.user}'.format(client))

@client.event
async def on_message(message):
    messageContent = message.content
    print(messageContent)
                      
client.run('tokengoeshere')

但是,它只有在我将它添加到我管理的服务器时才有效。

如果我在频道上但我没有添加机器人的权限,有什么方法可以阅读频道的消息?

【问题讨论】:

  • 不可能,我觉得很有道理

标签: python discord bots discord.py


【解决方案1】:

据我所知,如果机器人不在服务器中,则无法使用机器人读取频道,因为它对该服务器没有任何权限

【讨论】:

    猜你喜欢
    • 2017-09-16
    • 2019-01-15
    • 1970-01-01
    • 2019-09-16
    • 2020-12-23
    • 2017-03-04
    • 2023-03-14
    • 2019-02-20
    • 2017-07-29
    相关资源
    最近更新 更多