【问题标题】:I'm making a discord bot, and I want it to send a question in a channel referenced in the command. How do I do this?我正在制作一个不和谐的机器人,我希望它在命令中引用的频道中发送问题。我该怎么做呢?
【发布时间】:2022-01-10 20:34:33
【问题描述】:

例如,如果我键入 bot.send #general,机器人将在 #general 频道中发送预定消息。我将如何发出这个命令?谢谢!

【问题讨论】:

    标签: python discord bots


    【解决方案1】:
    @client.command()
    async def send(ctx, channel:discord.TextChannel, *, message):
        await channel.send(message)
    

    对于这个例子,我假设前缀是. 现在你可以做:.send #general Hi

    【讨论】:

      猜你喜欢
      • 2020-11-02
      • 2021-07-22
      • 2022-07-07
      • 1970-01-01
      • 2022-10-13
      • 1970-01-01
      • 2021-10-05
      • 1970-01-01
      • 2021-09-11
      相关资源
      最近更新 更多