Skip to content
This repository was archived by the owner on Mar 14, 2021. It is now read-only.

Team 14 #21

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Team 14 #21

wants to merge 7 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Mar 25, 2018

No description provided.

@gdude2002 gdude2002 changed the title PR before it's too late Team 14 Mar 25, 2018
Copy link
Contributor

@gdude2002 gdude2002 left a 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]
Copy link

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))
Copy link

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:
Copy link

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
Copy link

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.

Copy link

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:
Copy link

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.

@gdude2002
Copy link
Contributor

You code is failing to lint. Please see Travis for more information.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants