1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

Bugfix per /pug

This commit is contained in:
Steffo 2019-02-22 02:05:49 +01:00
parent 5174655f6b
commit 6709364df6
2 changed files with 6 additions and 0 deletions

View file

@ -187,6 +187,9 @@ class MATCHMAKING:
class PUG: class PUG:
HERE_HAVE_A_PUG = '🐶 Ecco, tieni un <a href="{image_url}">carlino</a>.' HERE_HAVE_A_PUG = '🐶 Ecco, tieni un <a href="{image_url}">carlino</a>.'
class ERRORS:
PRIVATE_CHAT_ONLY = "⚠ Foto di carlini possono essere inviate esclusivamente in chat privata, in seguito al Disegno di Legge Intergalattico n. 5116."
# Dice roller # Dice roller
class ROLL: class ROLL:

View file

@ -819,6 +819,9 @@ def cmd_emojify(bot: telegram.Bot, update: telegram.Update):
@command @command
def cmd_pug(bot: telegram.Bot, update: telegram.Update): def cmd_pug(bot: telegram.Bot, update: telegram.Update):
if update.effective_chat.type != telegram.Chat.PRIVATE:
reply(bot, update, strings.PUG.ERRORS.PRIVATE_CHAT_ONLY)
return
j = requests.get("https://dog.ceo/api/breed/pug/images/random").json() j = requests.get("https://dog.ceo/api/breed/pug/images/random").json()
reply(bot, update, strings.PUG.HERE_HAVE_A_PUG, disable_web_page_preview=False, image_url=j["message"]) reply(bot, update, strings.PUG.HERE_HAVE_A_PUG, disable_web_page_preview=False, image_url=j["message"])