diff --git a/strings.py b/strings.py index f7e2993c..ebae06f7 100644 --- a/strings.py +++ b/strings.py @@ -187,6 +187,9 @@ class MATCHMAKING: class PUG: HERE_HAVE_A_PUG = '🐶 Ecco, tieni un carlino.' + 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 class ROLL: diff --git a/telegrambot.py b/telegrambot.py index 76a189f4..f3720490 100644 --- a/telegrambot.py +++ b/telegrambot.py @@ -819,6 +819,9 @@ def cmd_emojify(bot: telegram.Bot, update: telegram.Update): @command 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() reply(bot, update, strings.PUG.HERE_HAVE_A_PUG, disable_web_page_preview=False, image_url=j["message"])