Team 18 #7
Team 18 #7
Conversation
Fix Pipfile dependencies
Exclude virtualenv from Flake8 linting. Again.
double spaces hurt me
Allows you to get human readable level of danger
|
|
| h = len(otherword) - len(word) | ||
| word += '~' * h | ||
| return word | ||
| ''' |
lemonsaurus
Mar 24, 2018
Member
docstring before helper functions please.
docstring before helper functions please.
| @@ -0,0 +1,45 @@ | |||
| # rattle - easy word similarity detection | |||
| def check_word(word, wordset, threshold=0.8): | |||
| def get_shortest(x, y): | |||
lemonsaurus
Mar 24, 2018
Member
These helper functions should also have docstrings.
These helper functions should also have docstrings.
| length_diff_multiplier = 1.08 | ||
| mp_count = 1 | ||
| shorter = '' | ||
| if shortest == word: |
lemonsaurus
Mar 24, 2018
Member
This function desperately needs block comments. runs a bit hot.
This function desperately needs block comments. runs a bit hot.
[UPDATE] Ignored a silly rule from flake8.
…d fixed a core issue with the command.
| from discord.ext.commands import AutoShardedBot, Context, command | ||
|
|
||
| from ..tools import rattle |
gdude2002
Mar 25, 2018
Contributor
Please no relative imports.
Please no relative imports.
| log = logging.getLogger(__name__) | ||
| db = load(open('bot/cogs/snek.pickledb', 'rb')) # are we going to move this db elsewhere? | ||
| SNAKE_NAMES = db.keys() # make a list of common names for snakes, used for random snake and autocorrect | ||
| DEBUG = True |
gdude2002
Mar 25, 2018
Contributor
Hardcoded debug mode?
Hardcoded debug mode?
| embed.set_footer(text="Information from Wikipedia and snakedatabase.org. Information has been " \ | ||
| "automatically fetched and may not be accurate.") | ||
| await ctx.send(embed=embed) | ||
|
|
||
| # Any additional commands can be placed here. Be creative, but keep it to a reasonable amount! |
gdude2002
Mar 25, 2018
Contributor
With 12 hours to go, you have no extra functionality!
With 12 hours to go, you have no extra functionality!
Debug is now based on the presence of the environment variable SNAKES_DEBUG
|
Very few issues, and nothing major. You did a great job documenting the project making your code clear. Can't wait to see what you'll make next Jam! |
| parent = command.parent | ||
|
|
||
| if parent and command: | ||
| help_command = (self.bot.get_command("help"), parent.name, command.name) |
Zwork101
Apr 3, 2018
Including the ( and ) is unnecessary, you can accomplish the same feat with simply
help_command = self.bot.get_command("help"), parent.name, command.name
Including the ( and ) is unnecessary, you can accomplish the same feat with simply
help_command = self.bot.get_command("help"), parent.name, command.name| f"Sorry, an unexpected error occurred. Please let us know!\n\n```{e}```" | ||
| ) | ||
| raise e.original | ||
| log.error(f"COMMAND ERROR: '{e}'") |
Zwork101
Apr 3, 2018
This isn't logged if a non-expected CommandInvokeError happens. You could either wrap the ifs in a try - finally block, however just logging the error before you raise it would be fine.
This isn't logged if a non-expected CommandInvokeError happens. You could either wrap the ifs in a try - finally block, however just logging the error before you raise it would be fine.
|
|
||
| log.debug(f"{before.display_name} roles changing from {before_role_names} to {after_role_names}") | ||
|
|
||
| if OWNER_ROLE in role_ids: |
Zwork101
Apr 3, 2018
You do this process twice, you should make a function that does this. Don't repeat yourself 😉
You do this process twice, you should make a function that does this. Don't repeat yourself
| DEBUG = environ.get('SNAKES_DEBUG', None) | ||
| dprint = print if DEBUG else lambda *a, **k: None # -1 index is used for easy temp debug hardcode | ||
|
|
||
| SNEK_FACTS = json.loads(open('bot/cogs/facts.json', 'r', encoding='utf-8').read()) |
Zwork101
Apr 3, 2018
You never close this file, or the snek,picklebd file.
You never close this file, or the snek,picklebd file.
| class NoGuessError(Exception): | ||
| def __init__(self, message='', debugdata=None): | ||
| self.message = message | ||
| self.debugdata = debugdata |
Zwork101
Apr 3, 2018
This is python, let's use _ where there should be a space:
class NoGuessError(Exception):
def __init__(self, message='', debug_data=None):
self.message = message
self.debug_data = debug_data
This is python, let's use _ where there should be a space:
class NoGuessError(Exception):
def __init__(self, message='', debug_data=None):
self.message = message
self.debug_data = debug_data| '💀💀': 'Venomous, harmful', | ||
| '💀💀💀': 'Venomous, dangerous', | ||
| '💀💀💀💀': 'Venomous, very dangerous', | ||
| '💀💀💀💀💀': 'Venomous, extremely dangerous.' |
Zwork101
Apr 3, 2018
Could this be moved into a json file, that's already loaded?
Could this be moved into a json file, that's already loaded?
| "Tumblr_m2g660GN9z1qcwgmzo1_1280.png/revision/latest?cb=20120611212456" | ||
| scient = 'Chironex fleckeri' | ||
| length = '9.8 ft' | ||
| custom = True |
Zwork101
Apr 3, 2018
These 3 sneks fall under the same issue as the danger dict. Move this data into a json file!
These 3 sneks fall under the same issue as the danger dict. Move this data into a json file!
Woot