imaginaryfriend/src/handler/commands/meow.py

14 lines
358 B
Python
Raw Normal View History

2017-04-16 15:35:12 +02:00
from .base import Base
from urllib.request import build_opener, HTTPRedirectHandler
class Meow(Base):
name = 'meow'
aliases = [':3', '=3']
2017-08-19 17:19:21 +02:00
def execute(self, command):
2017-04-16 15:35:12 +02:00
opener = build_opener(HTTPRedirectHandler)
2017-08-19 17:19:21 +02:00
req = opener.open('http://thecatapi.com/api/images/get?format=src')
2017-04-16 15:35:12 +02:00
2017-08-19 17:19:21 +02:00
self.send_photo(command, photo=req.url)