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]),