Merge pull request #48 from lalanza808/patch-3

add .yeezy
This commit is contained in:
jw 2020-09-23 16:54:14 -07:00 committed by GitHub
commit 7db20d993d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 6 deletions

View File

@ -889,3 +889,13 @@ def weather(bot, trigger):
except: except:
bot.say("The earth is on fire 🌎🔥") bot.say("The earth is on fire 🌎🔥")
@sopel.module.commands('yeezy')
def yeezy(bot, trigger):
headers = {'User-Agent': 'monerobux-irc-bot-#wownero'}
resp = requests.get('https://api.kanye.rest', headers=headers, timeout=3)
resp.raise_for_status()
blob = resp.json()
if 'quote' not in blob or not isinstance(blob['quote'], str):
raise Exception('malformed response')
bot.say(blob['quote'])