【问题标题】:message in channel discord bot频道不和谐机器人中的消息
【发布时间】:2020-06-14 18:09:10
【问题描述】:

我想知道如何使用命令在某个频道(在 python 中)发送消息

我的命令:

@bot.command() @commands.has_role("Administrator") async def message(ctx, message): await ctx.channel.purge(limit=1) await ctx.send(message)

【问题讨论】:

    标签: python discord


    【解决方案1】:

    您必须获取要发送消息的频道ID

    await ctx.channel.purge(limit=1)
    chn = bot.get_channel(721666738835685437)
    await chn.send(message)
    

    【讨论】:

      猜你喜欢
      • 2020-10-25
      • 2021-08-14
      • 2020-12-23
      • 2018-11-19
      • 2020-04-21
      • 1970-01-01
      • 2020-02-19
      • 2021-09-11
      • 2020-12-18
      相关资源
      最近更新 更多