From 249b61966c88a6fb54cd8da81a0637b67b0bf9ca Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 20 Jan 2017 13:10:58 +0100 Subject: [PATCH] =?UTF-8?q?magari=20stavolta=20=C3=A8=20quella=20buona?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index cceba457..7fec1299 100644 --- a/bot.py +++ b/bot.py @@ -477,14 +477,16 @@ def getrygimage(): telegram.sendmessage("Puoi mettere solo due lettere.") else: directory = "/var/www/html/rygimages/{}.png" - infile = " image/svg+xml {} ".format(cmd[1]).encode() + infile = open("basiclogo.svg", "r") + indata = infile.read().format(cmd[1]).encode() + infile.close() 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) + cairosvg.svg2png(bytestring=indata, write_to=outfile) outfile.close() telegram.sendmessage("[Scarica](http://royal.steffo.me/rygimages/{}.png)" " la tua immagine del profilo Royal Games!".format(cmd[1]),