本文整理汇总了Python中discord.ext.commands.HelpCommand方法的典型用法代码示例。如果您正苦于以下问题:Python commands.HelpCommand方法的具体用法?Python commands.HelpCommand怎么用?Python commands.HelpCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类discord.ext.commands
的用法示例。
在下文中一共展示了commands.HelpCommand方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_command_formatting
# 需要导入模块: from discord.ext import commands [as 别名]
# 或者: from discord.ext.commands import HelpCommand [as 别名]
def add_command_formatting(self, command):
"""A utility function to format the non-indented block of commands and groups.
Parameters
------------
command: :class:`Command`
The command to format.
"""
signature = self.get_command_signature(command)
self.embed_paginator.add_field(name=signature)
if command.description:
self.embed_paginator.extend_field(command.description)
if command.help:
try:
self.embed_paginator.extend_field(command.help)
except ValueError:
for line in command.help.splitlines():
self.embed_paginator.extend_field(line)
# ===== HelpCommand overrides =====
示例2: __init__
# 需要导入模块: from discord.ext import commands [as 别名]
# 或者: from discord.ext.commands import HelpCommand [as 别名]
def __init__(self, bot):
self.bot = bot
self._original_help_command = bot.help_command
bot.help_command = HelpCommand(verify_checks=False)
bot.help_command.cog = self