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")