-
-
Notifications
You must be signed in to change notification settings - Fork 16
Team 14 #21
base: master
Are you sure you want to change the base?
Team 14 #21
Conversation
Adding W503 and E226 to flake8 ignore list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far, all your changes are either:
- An added
.DS_Store
file (which should be removed) - File permissions changes
- Formatting changes
C'mon guys, only 8 and a half hours left!
async with self.bot.http_session.get(f"https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro=&explaintext=&titles={query}") as resp: | ||
data = await resp.json() | ||
data = data['query'] | ||
em.description = (data["pages"][list(data["pages"].keys())[0]]["extract"])[:2000] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line would look a lot better split over several lines. There's no need to have it all on a single line.
:param ctx: Context object passed from discord.py | ||
:param name: Optional, the name of the snake to get information for - omit for a random snake | ||
""" | ||
|
||
em = discord.Embed(title=str(query)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's nothing wrong with using embed
as the variable name. It's much easier to follow.
:param ctx: Context object passed from discord.py | ||
:param name: Optional, the name of the snake to get information for - omit for a random snake | ||
""" | ||
|
||
em = discord.Embed(title=str(query)) | ||
em.set_footer(text='Powered by wikipedia.org') | ||
async with self.bot.http_session.get(f"https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro=&explaintext=&titles={query}") as resp: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to have this string format defined on a separate line. Travis agrees.
import logging | ||
from typing import Any, Dict | ||
|
||
from discord.ext.commands import AutoShardedBot, Context, command | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
import discord |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module level import should be at the top of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(preferably before from discord.ext.commands import AutoShardedBot, Context, command
)
import logging | ||
from typing import Any, Dict | ||
|
||
from discord.ext.commands import AutoShardedBot, Context, command | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
import discord | ||
|
||
class Snakes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should have two blank lines before a definition.
You code is failing to lint. Please see Travis for more information. |
No description provided.