所以我试图建立一个命令,你说喜欢;说#channel hi,然后它向频道发送消息。
@commands.command()
@commands.has_permissions(manage_channels=True)
async def say(self,):
答案 0 :(得分:2)
你可以这样做:
@commands.command()
@commands.has_permissions(manage_channels=True)
async def say(self, channel: discord.TextChannel = None, *, message):
await channel.send(message)
频道是您要将消息发送到的服务器文本频道。此外,正如您所看到的,我在命令中使用了 *
。这意味着您可以将多个单词写为消息: )