Merge branch 'doggos' into 'master'
doggos, fixes #30 Closes #30 See merge request ldooks/dragon-bot!52
This commit is contained in:
commit
848abbd546
18
app/doggos.py
Normal file
18
app/doggos.py
Normal 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
|
||||||
|
)
|
@ -13,6 +13,7 @@ import decide
|
|||||||
import define_word
|
import define_word
|
||||||
import discord
|
import discord
|
||||||
import docker
|
import docker
|
||||||
|
import doggos
|
||||||
import eight_ball
|
import eight_ball
|
||||||
import excuse
|
import excuse
|
||||||
import get_from_reddit
|
import get_from_reddit
|
||||||
@ -103,6 +104,12 @@ async def on_message(message):
|
|||||||
define_word.get_definition(message.content)
|
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'):
|
if message.content.startswith('!excuse'):
|
||||||
await client.send_message(message.channel, excuse.get_excuse())
|
await client.send_message(message.channel, excuse.get_excuse())
|
||||||
|
|
||||||
|
@ -27,6 +27,10 @@ def get_help_message(method):
|
|||||||
' is specified, defaults to 10.\nrestart: will restart the min',
|
' is specified, defaults to 10.\nrestart: will restart the min',
|
||||||
'ecraft server.'
|
'ecraft server.'
|
||||||
],
|
],
|
||||||
|
'dog': [
|
||||||
|
'Returns the URL to a G O O D B O Y E or G I R L',
|
||||||
|
'\nUsage: !dog'
|
||||||
|
],
|
||||||
'excuse': [
|
'excuse': [
|
||||||
'Generates a random excuse you can give your boss',
|
'Generates a random excuse you can give your boss',
|
||||||
'\nUsage: !excuse'
|
'\nUsage: !excuse'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user