[Help] No help without a docstring #2415

Closed
opened 2019-02-04 23:06:01 +01:00 by Zephyrkul · 2 comments
Zephyrkul commented 2019-02-04 23:06:01 +01:00 (Migrated from github.com)

Other bugs

What were you trying to do?

[p]help <command>
alternatively, [p]<command> with missing required arguments.

What were you expecting to happen?

The help embed to show.

What actually happened?

Nothing, if the docstring for the command doesn't exist or is empty.

How can we reproduce this issue?

class Test(commands.Cog):
    @commands.command()
    async def test(self, ctx, *, required):
        pass

[p]help test or [p]test
No response.


class Test(commands.Cog):
    @commands.command()
    async def test(self, ctx, *, required):
        """"""
        # empty docstring
        pass

[p]help test or [p]test
No response.


class Test(commands.Cog):
    @commands.command()
    async def test(self, ctx, *, required):
        """
        """
        pass

[p]help test or [p]test
Help embed shows, but with a random line:
Screenshot from Gyazo


class Test(commands.Cog):
    @commands.command()
    async def test(self, ctx, *, required):
        """this is a docstring"""
        pass

[p]help test or [p]test
Help embed shows normally.

# Other bugs #### What were you trying to do? `[p]help <command>` alternatively, `[p]<command>` with missing required arguments. #### What were you expecting to happen? The help embed to show. #### What actually happened? Nothing, if the docstring for the command doesn't exist or is empty. #### How can we reproduce this issue? ```py class Test(commands.Cog): @commands.command() async def test(self, ctx, *, required): pass ``` `[p]help test` or `[p]test` No response. --- ```py class Test(commands.Cog): @commands.command() async def test(self, ctx, *, required): """""" # empty docstring pass ``` `[p]help test` or `[p]test` No response. --- ```py class Test(commands.Cog): @commands.command() async def test(self, ctx, *, required): """ """ pass ``` `[p]help test` or `[p]test` Help embed shows, but with a random line: [![Screenshot from Gyazo](https://gyazo.com/fa66849952897d686e4c88980318be46/raw)](https://gyazo.com/fa66849952897d686e4c88980318be46) --- ```py class Test(commands.Cog): @commands.command() async def test(self, ctx, *, required): """this is a docstring""" pass ``` `[p]help test` or `[p]test` Help embed shows normally.
mikeshardmind commented 2019-05-22 01:54:48 +02:00 (Migrated from github.com)

This is still an issue currently. While it can be rectified, I'm of the opinion it isn't useful to special case help for this, and is more useful to our users to require a docstring in commands.

While I'm not completely made up on this, I don't think empty docstrings should be considered a feature.

A suitable fix would be to enforce this at command add (next to enforcing our subclassed commands) or if we end up special casing this, swapping an empty docstring for "\u200b" in embeds, and "" in code blocks

This is still an issue currently. While it can be rectified, I'm of the opinion it isn't useful to special case help for this, and is more useful to our users to require a docstring in commands. While I'm not completely made up on this, I don't think empty docstrings should be considered a feature. A suitable fix would be to enforce this at command add (next to enforcing our subclassed commands) or if we end up special casing this, swapping an empty docstring for `"\u200b"` in embeds, and `""` in code blocks
Tobotimus commented 2019-05-22 03:58:09 +02:00 (Migrated from github.com)

Eh, I think a command with no docstring should still show help, just with the signature and no description. It shouldn't be difficult, I see no reason to ban them

Eh, I think a command with no docstring should still show help, just with the signature and no description. It shouldn't be difficult, I see no reason to ban them
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#2415
No description provided.