doggos, fixes #30

This commit is contained in:
Luke Robles 2017-10-02 17:49:14 +00:00
parent dfee44f829
commit 2dcdcebfb0
3 changed files with 29 additions and 0 deletions

18
app/doggos.py Normal file
View File

@ -0,0 +1,18 @@
import random
import requests
def get_dog():
return random.choice([random_sheeb, random_dog])()
def random_sheeb():
return requests.get(
'http://shibe.online/api/shibes?count=1&urls=true'
).text.split('"')[1]
def random_dog():
return "https://random.dog/{}".format(
requests.get('https://random.dog/woof').text
)

View File

@ -13,6 +13,7 @@ import decide
import define_word
import discord
import docker
import doggos
import eight_ball
import excuse
import get_from_reddit
@ -103,6 +104,12 @@ async def on_message(message):
define_word.get_definition(message.content)
)
if message.content.startswith('!dog'):
await client.send_message(
message.channel,
doggos.get_dog()
)
if message.content.startswith('!excuse'):
await client.send_message(message.channel, excuse.get_excuse())

View File

@ -27,6 +27,10 @@ def get_help_message(method):
' is specified, defaults to 10.\nrestart: will restart the min',
'ecraft server.'
],
'dog': [
'Returns the URL to a G O O D B O Y E or G I R L',
'\nUsage: !dog'
],
'excuse': [
'Generates a random excuse you can give your boss',
'\nUsage: !excuse'