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

Commit b0d66cb

Browse files
committed
it works
1 parent 0377564 commit b0d66cb

File tree

2 files changed

+12
-28
lines changed

2 files changed

+12
-28
lines changed

bot/cogs/get_info.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
async def get_snek(*args):
2+
if 'python' in args:
3+
return 'its a programming language'
4+
else:
5+
return 'its a reptile'

bot/cogs/snakes.py

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
log = logging.getLogger(__name__)
88

9+
from bot.cogs import get_info
10+
911

1012
class Snakes:
1113
"""
@@ -15,34 +17,11 @@ class Snakes:
1517
def __init__(self, bot: AutoShardedBot):
1618
self.bot = bot
1719

18-
async def get_snek(self, name: str = None) -> Dict[str, Any]:
19-
"""
20-
Go online and fetch information about a snake
21-
22-
The information includes the name of the snake, a picture of the snake, and various other pieces of info.
23-
What information you get for the snake is up to you. Be creative!
24-
25-
If "python" is given as the snake name, you should return information about the programming language, but with
26-
all the information you'd provide for a real snake. Try to have some fun with this!
27-
28-
:param name: Optional, the name of the snake to get information for - omit for a random snake
29-
:return: A dict containing information on a snake
30-
"""
31-
32-
@command()
33-
async def get(self, ctx: Context, name: str = None):
34-
"""
35-
Go online and fetch information about a snake
36-
37-
This should make use of your `get_snek` method, using it to get information about a snake. This information
38-
should be sent back to Discord in an embed.
39-
40-
:param ctx: Context object passed from discord.py
41-
:param name: Optional, the name of the snake to get information for - omit for a random snake
42-
"""
43-
44-
# Any additional commands can be placed here. Be creative, but keep it to a reasonable amount!
45-
20+
@command(name='blah')
21+
async def get(self, ctx: Context, *args):
22+
snake_info = await get_info.get_snek(*args)
23+
await ctx.send(snake_info)
24+
4625

4726
def setup(bot):
4827
bot.add_cog(Snakes(bot))

0 commit comments

Comments
 (0)