Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Aggiungi():
- from numeri import numero #Importa il file numeri, dove ogni volta che viene cliccato il tasto "✅" aggiunge un voto.
- numero2 = numero + 1
- numeri = open("numeri.py", "w")
- numeri.write("numero = " + str(numero2))
- numeri.close() #Prende il valore precedente di "numero" e gli aggiunge 1
- #momento dell'invio del comando
- @bot.command("test")
- def portoarmi_command(chat, message, args):
- if len(args) == 0:
- chat.send("Inserisci un Nickname")
- elif len(args) != 1:
- chat.send("Non puoi inserire due o più valori")
- close()
- username = args[0]
- chat.send("💣 *MINEWOOD | PORTO D'ARMI* \n \n ℹ️ Hai attivato la richiesta del \n *porto d'armi* per l'utente *%s*. \n \n✅ *Voti a favore*: 0 \n⛔️ *Voti a sfavore*: 0" % username, attach=btns2)
- username_file = open("username.txt", "w+")
- username_file.write(username)
- username_file.close()
- #Una volta cliccato su "✅" aggiunge un voto.
- @bot.callback("Positivo")
- def positivo_callblack(query, chat, message):
- Aggiungi()
- f=open('/home/username.txt') #Prende l'username della persona scelta nel comando precendete
- lines=f.readlines()
- string = lines[0]
- message.edit("💣 *MINEWOOD | PORTO D'ARMI* \n \n ℹ️ Hai attivato la richiesta del \n *porto d'armi* per l'utente %s \n \n✅ *Voti a favore*: %s \n⛔️ *Voti a sfavore*: %s" % (string, numero, string), attach=btns2)
- query.notify("Voto aggiunto con successo!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement