This repository was archived by the owner on Mar 14, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 16
Team 4 #5
Open
Refisio
wants to merge
11
commits into
python-discord:master
Choose a base branch
from
Refisio:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Team 4 #5
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bc07777
Merge pull request #1 from discord-python/master
5b36849
Merge pull request #2 from discord-python/master
dcaebf4
Add .vscode to .gitignore
RoberTnf eb4e486
Add wikipedia to modules
RoberTnf aa40d32
Snake game created
RoberTnf 1f221ea
move snakegame to the bot folder
RoberTnf fd7a468
Add documentation and fix snake -> snek
RoberTnf 6191f2f
Move to using emojis
RoberTnf 922e65a
Created 'get_snek' function and 'get' command.
a9b8d9f
Merge pull request #3 from discord-python/master
62f3494
Merge pull request #4 from discord-python/master
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -102,3 +102,4 @@ ENV/ | |
|
|
||
| # PyCharm | ||
| .idea/ | ||
| .vscode/settings.json | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,8 @@ | |
|
|
||
| from discord.ext.commands import AutoShardedBot, Context, command | ||
|
|
||
| from .snakegame import SnakeGame | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You also seem to be missing this file |
||
|
|
||
| log = logging.getLogger(__name__) | ||
|
|
||
|
|
||
|
|
@@ -12,8 +14,9 @@ class Snakes: | |
| Snake-related commands | ||
| """ | ||
|
|
||
| def __init__(self, bot: AutoShardedBot): | ||
| def __init__(self, bot: AutoShardedBot, game: SnakeGame): | ||
| self.bot = bot | ||
| self.game = game | ||
|
|
||
| async def get_snek(self, name: str = None) -> Dict[str, Any]: | ||
| """ | ||
|
|
@@ -42,8 +45,12 @@ async def get(self, ctx: Context, name: str = None): | |
| """ | ||
|
|
||
| # Any additional commands can be placed here. Be creative, but keep it to a reasonable amount! | ||
| @command() | ||
| async def play(self, ctx: Context, order): | ||
| if order == "left": | ||
| await ctx.send(self.game) | ||
|
|
||
|
|
||
| def setup(bot): | ||
| bot.add_cog(Snakes(bot)) | ||
| bot.add_cog(Snakes(bot, SnakeGame((5, 5)))) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is quite weird - maybe you should instantiate it in the |
||
| log.info("Cog loaded: Snakes") | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Relative imports are discouraged