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:
parent
5174655f6b
commit
6709364df6
2 changed files with 6 additions and 0 deletions
|
@ -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:
|
||||||
|
|
|
@ -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"])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue