Conversation
Pipfile
Outdated
| aiohttp = "<2.3.0,>=2.0.0" | ||
| websockets = ">=4.0,<5.0" | ||
| "beautifulsoup4" = "*" | ||
| requests-html = "*" |
There was a problem hiding this comment.
It looks like you've edited this file by hand. This is bad practise, but at least you've updated the lockfile as well.
Please be careful about using requests - it's not asynchronous.
There was a problem hiding this comment.
I am 100% sure that I did not update the Pipfile by hand. I used pipenv install requests-html
There was a problem hiding this comment.
Okay. Either way, we've made a statement about the wikipedia module on Discord, and the same applies to Requests. Requests does not support asyncio, and you're going to want to avoid any solution that doesn't.
[UPDATE] Ignored a silly rule from flake8.
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit. Adding random snakes
Added Python bot message
Adding W503 and E226 to flake8 ignore list.
.gitignore
Outdated
| .Python | ||
| env/ | ||
| .idea/ | ||
| .env |
There was a problem hiding this comment.
Aren't these both already in the gitignore?
Pipfile
Outdated
| aiohttp = "<2.3.0,>=2.0.0" | ||
| websockets = ">=4.0,<5.0" | ||
| "beautifulsoup4" = "*" | ||
| wikipedia = "*" |
There was a problem hiding this comment.
If you're not using this, you should pipenv uninstall it.
bot/cogs/snakes.py
Outdated
| @@ -1,8 +1,10 @@ | |||
| # coding=utf-8 | |||
| import logging | |||
| import logging, aiohttp, random, wikipedia | |||
There was a problem hiding this comment.
No, you should be using separate lines, and they should be in alphabetical order.
bot/cogs/snakes.py
Outdated
| Snake-related commands | ||
| """ | ||
| python_info = ''' | ||
| Python (Programming Language) |
There was a problem hiding this comment.
You should probably remove all these huge indents.
There was a problem hiding this comment.
You also don't need the \ns in here. Those are taken from how you've formatted the string.
bot/cogs/snakes.py
Outdated
| :param name: Optional, the name of the snake to get information for - omit for a random snake | ||
| :return: A dict containing information on a snake | ||
| """ | ||
| name = str(name) |
There was a problem hiding this comment.
No, don't do this. If there's no snake name passed, this will now be "None", which is annoying to check for.
| if name.lower() == 'python': | ||
| name = self.python_info | ||
|
|
||
| return name |
There was a problem hiding this comment.
This method doesn't work at all. Return name? Are you still working on this?
bot/cogs/snakes.py
Outdated
| :param name: Optional, the name of the snake to get information for - omit for a random snake | ||
| """ | ||
| # await ctx.send(BeautifulSoup(text, 'lxml').find("title")) | ||
| name = str(name) |
There was a problem hiding this comment.
Again, why are you doing this?
| title = soup.find('h1').text | ||
| description = soup.find('table').text | ||
|
|
||
| em = discord.Embed(title=title, description=description) |
There was a problem hiding this comment.
While you should be creating the embed in this method, you should be retrieving the information over in get_snek().
bot/cogs/snakes.py
Outdated
|
|
||
| # Any additional commands can be placed here. Be creative, but keep it to a reasonable amount! | ||
| @command() | ||
| async def snake(self, ctx: Context, x=50, y=30): |
There was a problem hiding this comment.
Really fun idea. But maybe a little ambitious for you guys.
There was a problem hiding this comment.
This is super hard to read, I'm going to have to test it to really see what it does. Maybe you could comment it?
Also, perhaps you could use reactions via wait_for_reactions() instead of a list of inputs?
converted all dict types apart from head to tuples added snake tail
Delete unnecessary code
Adding snake description
improved message deletion, mentions, Python is now Open-Source
|
You code is failing to lint. Please see Travis for more information. |
No description provided.