【问题标题】:how to ignore other discord channels如何忽略其他不和谐频道
【发布时间】:2021-10-29 11:42:27
【问题描述】:

我正在寻找代码。我从 1 个不和谐频道而不是从每个频道获取实时文本

例子

  • 服务器 1

    • a 频道
    • 频道 b
    • 频道 c
  • 服务器 2

    • 频道 a1
    • 频道 b1
  • 服务器 3

    • 频道a2
    • 频道 b2
    • 频道 c2

我想查看频道 b1 的示例,仅显示文本,而不是所有频道/服务器

我现在有这个代码

import discord

client = discord.Client()

@client.event
async def on_message(message):
    if message.channel.id == [id_of_channel_b1]:"channelid"
    

client.run (<mytoken>)

希望有人能帮助我

如有问题,请向我提问,如果您不理解问题,也许可以更好地解释一下

【问题讨论】:

  • 请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。

标签: python python-3.x pycharm discord discord.py


【解决方案1】:

删除[]

if message.channel.id == id_of_channel_b1:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-15
    • 2021-11-23
    • 2021-06-13
    • 1970-01-01
    • 2020-05-07
    • 2020-01-23
    相关资源
    最近更新 更多