vérif admin

This commit is contained in:
nemesis 2018-07-22 22:58:52 +02:00
parent 7f656a5ea0
commit b349d40311

View file

@ -32,6 +32,7 @@ bot = None
clock = {} clock = {}
stats = {} stats = {}
quotes = {} quotes = {}
admins = [] # Admins du bot
def horloge_read(): def horloge_read():
global clock global clock
@ -996,6 +997,7 @@ def quote(room,event):
reponse = reponse + cle[0] + " / " + str(cle[1]) + " : " + valeur + "\n" reponse = reponse + cle[0] + " / " + str(cle[1]) + " : " + valeur + "\n"
salon.send_text(reponse) salon.send_text(reponse)
elif (len(args) > 1 and args[0] == "del"): elif (len(args) > 1 and args[0] == "del"):
if (event['sender'] in admins):
id = args[1] id = args[1]
salon = verifPMRoom(room,event) salon = verifPMRoom(room,event)
reponse = "Voici la citation supprimée : \n" reponse = "Voici la citation supprimée : \n"
@ -1044,11 +1046,17 @@ def main():
USERNAME = "" # Bot's username USERNAME = "" # Bot's username
PASSWORD = "" # Bot's password PASSWORD = "" # Bot's password
SERVER = "" # Matrix server URL SERVER = "" # Matrix server URL
global admins
print("admins")
for admin in admins:
print(admin)
if ('AUTH' in config): if ('AUTH' in config):
USERNAME = config['AUTH']['username'] # Bot's username USERNAME = config['AUTH']['username'] # Bot's username
PASSWORD = config['AUTH']['password'] # Bot's password PASSWORD = config['AUTH']['password'] # Bot's password
SERVER = config['AUTH']['server'] # Matrix server URL SERVER = config['AUTH']['server'] # Matrix server URL
admins = config['AUTH']['admin'] # Admins du bot
else: else:
print("Probleme de lecture de configuration asmodee.ini") print("Probleme de lecture de configuration asmodee.ini")