From 22cb18872de10b334522eff9c8f9ff427f25228a Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 19 Jan 2017 21:01:26 +0100 Subject: [PATCH] b --- bot.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 4251946b..6177f1c6 100644 --- a/bot.py +++ b/bot.py @@ -478,13 +478,18 @@ def getrygimage(): else: directory = "/var/www/html/rygimages/{}.png" infile = b" image/svg+xml %s " % cmd[1].encode() + try: + outfile = open(directory.format(cmd[1]), "x") + outfile.close() + except Exception: + pass outfile = open(directory.format(cmd[1]), "wb") cairosvg.svg2png(bytestring=infile, write_to=outfile) + outfile.close() telegram.sendmessage("[Scarica](http://royal.steffo.me/rygimages/{}.png)" " la tua immagine del profilo Royal Games!".format(cmd[1]), sentin, source) - def ciaospaggia(): # Buongiorno, stellina! print("@" + username + ": /ciaospaggia")