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

magari stavolta è quella buona

This commit is contained in:
Steffo 2017-01-20 13:16:29 +01:00
parent 69e888d36d
commit 1b1c88fd65

3
bot.py
View file

@ -472,6 +472,7 @@ def lolfree():
def getrygimage(): def getrygimage():
# Ricevi il link alla tua immagine del profilo Royal Games. # Ricevi il link alla tua immagine del profilo Royal Games.
print("@" + username + ": /getrygimage") print("@" + username + ": /getrygimage")
cmd = text.split(" ", 1)
if len(cmd) > 1: if len(cmd) > 1:
if len(cmd[1]) > 2: if len(cmd[1]) > 2:
telegram.sendmessage("Puoi mettere solo due lettere.") telegram.sendmessage("Puoi mettere solo due lettere.")
@ -479,7 +480,9 @@ def getrygimage():
# FIXME: percorsi assoluti # FIXME: percorsi assoluti
directory = "/var/www/html/rygimages/{}.png" directory = "/var/www/html/rygimages/{}.png"
infile = open("/royal/bot/basiclogo.svg", "r") infile = open("/royal/bot/basiclogo.svg", "r")
print(infile.read())
indata = infile.read().format(cmd[1]).encode() indata = infile.read().format(cmd[1]).encode()
print(indata.decode())
infile.close() infile.close()
try: try:
outfile = open(directory.format(cmd[1]), "x") outfile = open(directory.format(cmd[1]), "x")