答案 0 :(得分:1)
您看到的是来自 customized discord-like 的 Xenon 聊天。此聊天允许您进行类似 Discord 的聊天部分,但模拟 Discord 的行为。 Xenon 是开源的,所以如果您想像他们一样做,只需检查他们的 repositories。
如果你想自定义你的机器人的 help 命令,你可以用最近的 discord.py-rewrite 更改来实现。要实现您想要的功能,您需要将 HelpCommand 或 MinimalHelpCommand 子类化,然后将其传递给 bot.help_command
。
以下代码显示了 MinimalHelpCommand 子类化的标准方法:
class MyHelpCommand(commands.MinimalHelpCommand):
def get_command_signature(self, command):
return '{0.clean_prefix}{1.qualified_name} {1.signature}'.format(self, command)
class MyCog(commands.Cog):
def __init__(self, bot):
self._original_help_command = bot.help_command
bot.help_command = MyHelpCommand()
bot.help_command.cog = self
def cog_unload(self):
self.bot.help_command = self._original_help_command
更多信息,discord.py 文档:https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#help-commands