Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pretty user names for replies, fix typo, predictable !help ordering #22

Merged
merged 3 commits into from
Apr 1, 2024

Conversation

lbatalha
Copy link
Contributor

No description provided.

utils.py Outdated
@@ -22,7 +22,7 @@
def help(cmd):
if cmd.args: # only reply on "!help"
return
commands = set(cmd.bot.commands.keys())
commands = cmd.bot.commands.keys()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait we call commands.remove() down below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its still a list, so no problem there?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ain't no list

>>> a = {}
>>> a.keys().remove()
AttributeError: 'dict_keys' object has no attribute 'remove'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced with del commands[name]

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

>>> a = {'cow': 'moo'}
>>> c = a.keys()
>>> del c['cow']
TypeError: 'dict_keys' object does not support item deletion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

converting to a list it is

@raylu raylu merged commit d2e2fb3 into raylu:main Apr 1, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants