def _help(self, *args, message):
if len(args) == 0:
docs = list(self.prefix + key + (f" ({cmd.hint})" if cmd.hint else "")
for key, cmd in self._commands.items() if key not in ("bots", "help"))
lines = textwrap.wrap("; ".join(docs), width=400)
for line in lines:
if isinstance(message.recipient, Channel):
await message.sender.message(line, notice=True)
else:
await message.sender.message(line)
elif len(args) == 1:
cmd = self._commands.get(args[0])
if not cmd:
return
if not cmd.doc:
await message.sender.message(
"No help available for that command",
notice=True)
else:
for line in cmd.doc.split("\n"):
await message.sender.message(line, notice=True)
评论列表
文章目录