Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

refactor: improve adding prefixed commands #575

Merged
merged 3 commits into from
Jul 29, 2022

Conversation

AstreaTSS
Copy link
Contributor

What type of pull request is this?

  • Non-breaking code change
  • Breaking code change
  • Documentation change/addition
  • Tests change

Description

This just improves Client.add_prefixed_command and PrefixedCommand.add_command. There's a slight speedup and the error message is slightly better.

Changes

  • Use commands.get instead of iterating through the dict's values to see if a command is a duplicate.
  • There's been minor changes to the error message that makes it more grammatically correct. I also have no idea what Black did there but it did a thing--

Checklist

  • I've formatted my code with Black
  • I've ensured my code works on Python 3.10.x
  • I've tested my code

This uses a cleaner and faster method to do so,
and also slightly improves the error messages.
@LordOfPolls LordOfPolls added the Improvement Something that is already implemented but can be done better label Jul 29, 2022
@LordOfPolls LordOfPolls merged commit ab9ff94 into NAFTeam:dev Jul 29, 2022
@AstreaTSS AstreaTSS deleted the add-pre-cmd-improve branch July 31, 2022 19:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Improvement Something that is already implemented but can be done better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants