1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-12-03 16:24:20 +00:00

NON LO SO NEMMENO IO AIUTO

This commit is contained in:
Steffo 2017-02-15 11:46:11 +01:00
parent 95a85a9602
commit 58706e445e
3 changed files with 20 additions and 16 deletions

View file

@ -86,6 +86,6 @@
y="0" y="0"
style="text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#783f04;fill-opacity:1;" /></flowRegion><flowPara style="text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#783f04;fill-opacity:1;" /></flowRegion><flowPara
id="flowPara3723" id="flowPara3723"
style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:28.96000099px;font-family:Ubuntu;-inkscape-font-specification:'Ubuntu Medium';fill:#783f04;fill-opacity:1;">{}<flowPara style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:28.96000099px;font-family:Ubuntu;-inkscape-font-specification:'Ubuntu Medium';fill:#783f04;fill-opacity:1;">REPLACEME<flowPara
id="flowPara19" /></flowPara></flowRoot> </g> id="flowPara19" /></flowPara></flowRoot> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

32
bot.py
View file

@ -478,19 +478,21 @@ def getrygimage():
telegram.sendmessage("Puoi mettere solo due lettere.") telegram.sendmessage("Puoi mettere solo due lettere.")
else: else:
# FIXME: percorsi assoluti # FIXME: percorsi assoluti
directory = "/var/www/html/rygimages/{}.png" directory = "/var/www/html/rygimages/{}.png".format(cmd[1])
infile = open("/royal/bot/basiclogo.svg", "r") infile = open("basiclogo.svg", "rb")
print(infile.read()) # FIXME: possibile exploit qui
indata = infile.read().format(cmd[1]).encode("utf-8") indata = infile.read().replace(b"REPLACEME", cmd[1].encode("utf-8"))
print(indata.decode("utf-8"))
infile.close() infile.close()
try: try:
outfile = open(directory.format(cmd[1]), "x") outfile = open(directory, "x")
outfile.write("")
outfile.close() outfile.close()
except Exception: except FileExistsError:
pass pass
outfile = open(directory.format(cmd[1]), "wb") outfile = open(directory, "wb")
cairosvg.svg2png(bytestring=indata, write_to=outfile) outdata = cairosvg.svg2png(bytestring=indata)
print(outdata)
outfile.write(outdata)
outfile.close() outfile.close()
telegram.sendmessage("[Scarica](http://royal.steffo.me/rygimages/{}.png)" telegram.sendmessage("[Scarica](http://royal.steffo.me/rygimages/{}.png)"
" la tua immagine del profilo Royal Games!".format(cmd[1]), " la tua immagine del profilo Royal Games!".format(cmd[1]),
@ -671,8 +673,10 @@ while True:
else: else:
print("@" + username + " bloccato.") print("@" + username + " bloccato.")
except Exception as e: except Exception as e:
telegram.sendmessage(chr(9762) + " *Errore critico:\n*" if __debug__:
"{0}\n\n" raise
"Secondo me, è colpa dello stagista.".format(repr(e)), -2141322) else:
print("\033[1mERRORE CRITICO:\n" telegram.sendmessage(chr(9762) + " *Errore critico:\n*"
"{0}\033[0m".format(repr(e))) "{0}\n\n"
"Secondo me, è colpa dello stagista.".format(repr(e)), -2141322)
print("\033[1mERRORE CRITICO:\n{0}\033[0m".format(repr(e)))

2
sm

@ -1 +1 @@
Subproject commit b3beb7f76214d6a8fa5d5954da762a4165442d4a Subproject commit ce3275c9b51ee7e7bb18020ae93d498a54cd7466