Browse Source

added requirements.txt, added dog command

master
angerstoner 7 years ago
parent
commit
967bcc50e9
  1. 5
      requirements.txt
  2. 14
      schneiderbot.py

5
requirements.txt

@ -0,0 +1,5 @@
python-telegram-bot
telegram
requests
random-cat
git+git://github.com/xNinjaKittyx/pydog.git#egg=pydog

14
schneiderbot.py

@ -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

Loading…
Cancel
Save