本文整理匯總了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