|
|
@ -9,6 +9,7 @@ import random |
|
|
|
import requests |
|
|
|
import datetime |
|
|
|
import cat |
|
|
|
import pydog |
|
|
|
|
|
|
|
MENSA_URL = { |
|
|
|
"zentral": "zentralmensa", |
|
|
@ -121,17 +122,25 @@ def help(bot, update): |
|
|
|
|
|
|
|
*Fun*: |
|
|
|
/cat - random cat (using thecatapi.com) |
|
|
|
/dog - random dog (https://dog.ceo/dog-api) |
|
|
|
/magie - random Axel Stoll qoute |
|
|
|
/manta - random Opel Manta joke |
|
|
|
|
|
|
|
/help - this help text""", parse_mode=ParseMode.MARKDOWN) |
|
|
|
|
|
|
|
def ccat(bot, update): |
|
|
|
def sendCat(bot, update): |
|
|
|
"""CUTE""" |
|
|
|
catfile = cat.getCat(); |
|
|
|
bot.send_photo(chat_id=update.message.chat_id, photo=open(catfile, 'rb')) |
|
|
|
os.remove(catfile) |
|
|
|
|
|
|
|
|
|
|
|
def sendDog(bot, update): |
|
|
|
"""CUTE 2.0""" |
|
|
|
dog = pydog.PyDog() |
|
|
|
bot.send_photo(chat_id=update.message.chat_id, photo=dog.get_random_image()) |
|
|
|
|
|
|
|
|
|
|
|
def magie(bot, update): |
|
|
|
"""MAGIEEEEEE""" |
|
|
|
rand = random.SystemRandom() |
|
|
@ -210,7 +219,8 @@ def main(): |
|
|
|
dp.add_handler(CommandHandler("magie", magie)) |
|
|
|
dp.add_handler(CommandHandler("manta", manta)) |
|
|
|
dp.add_handler(CommandHandler("mensa", mensa, pass_args=True)) |
|
|
|
dp.add_handler(CommandHandler("cat", ccat)) |
|
|
|
dp.add_handler(CommandHandler("cat", sendCat)) |
|
|
|
dp.add_handler(CommandHandler("dog", sendDog)) |
|
|
|
|
|
|
|
|
|
|
|
# log all errors |
|
|
|