generated from Nemesis/Exemple
modo sur invitation
This commit is contained in:
parent
794395c6cb
commit
b2105d40cd
1 changed files with 10 additions and 7 deletions
|
@ -1411,13 +1411,13 @@ def bienvenue(event): # Affichage d'un message d'accueil aux nouveaux venus
|
||||||
room.send_text("Bienvenue sur " + alias + ", " + nick + ". " + msg)
|
room.send_text("Bienvenue sur " + alias + ", " + nick + ". " + msg)
|
||||||
|
|
||||||
def modo(room,event): # Definition d'un moderateur
|
def modo(room,event): # Definition d'un moderateur
|
||||||
if (event['sender'] in admins):
|
|
||||||
global modos
|
global modos
|
||||||
lmod = []
|
lmod = []
|
||||||
try:
|
try:
|
||||||
lmod = modos[room.room_id]
|
lmod = modos[room.room_id]
|
||||||
except:
|
except:
|
||||||
lmod = []
|
lmod = []
|
||||||
|
if (event['sender'] in admins or event['sender'] in lmod):
|
||||||
args = event['content']['body'].split()
|
args = event['content']['body'].split()
|
||||||
args.pop(0)
|
args.pop(0)
|
||||||
if (len(args) > 1 and args[0] == "add"):
|
if (len(args) > 1 and args[0] == "add"):
|
||||||
|
@ -1492,7 +1492,6 @@ def module(room,event): # Definition des modules d'un salon
|
||||||
|
|
||||||
|
|
||||||
def invitations(room_id, state): # Reponse aux invitations
|
def invitations(room_id, state): # Reponse aux invitations
|
||||||
global bot
|
|
||||||
try:
|
try:
|
||||||
global bot
|
global bot
|
||||||
bot.client.join_room(room_id)
|
bot.client.join_room(room_id)
|
||||||
|
@ -1504,6 +1503,10 @@ def invitations(room_id, state): # Reponse aux invitations
|
||||||
modules[room.room_id, 'quote'] = True
|
modules[room.room_id, 'quote'] = True
|
||||||
if ('liste' in liste_mod):
|
if ('liste' in liste_mod):
|
||||||
modules[room.room_id, 'liste'] = True
|
modules[room.room_id, 'liste'] = True
|
||||||
|
global modos
|
||||||
|
if (modos.get(room.room_id,True) or len(modos[room.room_id]) == 0):
|
||||||
|
#modos[room.room_id] =
|
||||||
|
print(state)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
del bot
|
del bot
|
||||||
save()
|
save()
|
||||||
|
|
Loading…
Reference in a new issue