mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
magari stavolta è quella buona
This commit is contained in:
parent
2640ea8874
commit
249b61966c
1 changed files with 4 additions and 2 deletions
6
bot.py
6
bot.py
|
@ -477,14 +477,16 @@ def getrygimage():
|
|||
telegram.sendmessage("Puoi mettere solo due lettere.")
|
||||
else:
|
||||
directory = "/var/www/html/rygimages/{}.png"
|
||||
infile = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?> <svg xmlns:dc=\"http://purl.org/dc/elements/1.1/\"xmlns:cc=\"http://creativecommons.org/ns#\"xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"xmlns:svg=\"http://www.w3.org/2000/svg\"xmlns=\"http://www.w3.org/2000/svg\"id=\"svg3693\"stroke-miterlimit=\"10\"stroke-linecap=\"square\"stroke=\"none\"fill=\"none\"viewBox=\"0.0 0.0 720.0 720.0\"version=\"1.1\"> <metadata id=\"metadata3699\"> <rdf:RDF> <cc:Work rdf:about=\"\"> <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\" /> <dc:title></dc:title> </cc:Work> </rdf:RDF> </metadata> <defs id=\"defs3697\" /> <clipPath id=\"p.0\"> <path id=\"path3680\"clip-rule=\"nonzero\"d=\"m0 0l720.0 0l0 720.0l-720.0 0l0 -720.0z\" /> </clipPath> <g id=\"g3691\"clip-path=\"url(#p.0)\"> <path id=\"path3683\"fill-rule=\"nonzero\"d=\"m0 0l720.0 0l0 720.0l-720.0 0z\"fill=\"#ff7f00\" /> <path id=\"path3685\"fill-rule=\"nonzero\"d=\"m-1.0624952 275.66144l275.5697 0.0019226074l85.15396 -274.5596l85.15396 274.5596l275.5697 -0.0019226074l-222.94168 169.68524l85.1575 274.5584l-222.93948 -169.68835l-222.93948 169.68835l85.15747 -274.5584z\"fill=\"#ffff00\" /> <path id=\"path3687\"fill-rule=\"nonzero\"d=\"m-0.72440946 141.05511l721.44885 0l0 437.88977l-721.44885 0z\"fill-opacity=\"0.0\"fill=\"#000000\" /> <flowRoot style=\"fill:black;fill-opacity:1;stroke:none;font-family:sans-serif;font-style:normal;font-weight:normal;font-size:40px;line-height:25px;letter-spacing:0px;word-spacing:0px\"id=\"flowRoot3701\"xml:space=\"preserve\"><flowRegion id=\"flowRegion3703\"><rect y=\"187.54491\"x=\"37.724552\"height=\"351.37726\"width=\"589.58081\"id=\"rect3705\" /></flowRegion><flowPara id=\"flowPara3707\"></flowPara></flowRoot> <flowRoot style=\"font-style:normal;font-weight:normal;font-size:40px;line-height:25px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none\"id=\"flowRoot3709\"xml:space=\"preserve\"><flowRegion id=\"flowRegion3711\"><rect y=\"0\"x=\"0\"height=\"720\"width=\"720\"id=\"rect3713\" /></flowRegion><flowPara id=\"flowPara3715\" /></flowRoot> <flowRoot transform=\"matrix(18.416206,0,0,18.416206,-6272.7758,103.20272)\"style=\"font-style:normal;font-weight:normal;font-size:40px;line-height:25px;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#783f04;fill-opacity:1;stroke:none;\"id=\"flowRoot3717\"xml:space=\"preserve\"><flowRegion style=\"text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#783f04;fill-opacity:1;\"id=\"flowRegion3719\"><rect style=\"text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#783f04;fill-opacity:1;\"y=\"0\"x=\"0\"height=\"720\"width=\"720\"id=\"rect3721\" /></flowRegion><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;\"id=\"flowPara3723\">{}<flowPara></flowRoot> </g> </svg>".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]),
|
||||
|
|
Loading…
Reference in a new issue