Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
N
nardco
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneurs
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Yani ZIANI
nardco
Validations
d6304873
Valider
d6304873
rédigé
Il y a 5 ans
par
Loris TICHADOU
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
add quizz
parent
a01e9653
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
nardco.py
+45
-9
45 ajouts, 9 suppressions
nardco.py
avec
45 ajouts
et
9 suppressions
nardco.py
+
45
−
9
Voir le fichier @
d6304873
...
@@ -60,9 +60,14 @@ global cmdCarac
...
@@ -60,9 +60,14 @@ global cmdCarac
cmdCarac
=
"
$
"
cmdCarac
=
"
$
"
personnalizedCmd
=
{}
personnalizedCmd
=
{}
reponse
=
None
reponse
=
None
pas_reponse
=
[]
pas_reponse
=
[]
a_repondu
=
[]
a_repondu
=
[]
scores
=
{}
tour
=
0
total
=
0
def
isCommande
(
string
):
def
isCommande
(
string
):
global
cmdCarac
global
cmdCarac
...
@@ -140,6 +145,9 @@ class Boooob(ircbot.SingleServerIRCBot):
...
@@ -140,6 +145,9 @@ class Boooob(ircbot.SingleServerIRCBot):
global
reponse
global
reponse
global
a_repondu
global
a_repondu
global
pas_reponse
global
pas_reponse
global
tour
global
scores
global
total
canal
=
ev
.
target
()
canal
=
ev
.
target
()
...
@@ -209,16 +217,44 @@ class Boooob(ircbot.SingleServerIRCBot):
...
@@ -209,16 +217,44 @@ class Boooob(ircbot.SingleServerIRCBot):
if
"
Titch
"
in
personne
and
"
leave
"
in
message
and
"
nardco
"
in
message
:
if
"
Titch
"
in
personne
and
"
leave
"
in
message
and
"
nardco
"
in
message
:
serv
.
part
(
canal
)
serv
.
part
(
canal
)
if
reponse
is
not
None
and
fuzz
.
ratio
(
message
,
reponse
)
>
60
and
personne
not
in
a_repondu
:
if
reponse
is
not
None
:
if
fuzz
.
ratio
(
message
,
reponse
)
>
60
and
personne
not
in
a_repondu
:
serv
.
privmsg
(
canal
,
personne
+
"
a trouvé la reponse : {0} ! Bien joué !
"
.
format
(
reponse
))
serv
.
privmsg
(
canal
,
personne
+
"
a trouvé la reponse : {0} ! Bien joué !
"
.
format
(
reponse
))
reponse
=
None
reponse
=
None
a_repondu
=
[]
a_repondu
=
[]
pas_reponse
=
[]
pas_reponse
=
[]
tour
+=
1
if
reponse
is
not
None
and
message
in
pas_reponse
and
personne
not
in
a_repondu
:
if
personne
in
scores
.
keys
()
:
scores
[
personne
]
+=
1
else
:
scores
[
personne
]
=
1
if
tour
==
total
+
1
:
maxScore
=
0
gagnant
=
''
for
pseudo
in
scores
.
keys
()
:
if
scores
[
pseudo
]
>
maxScore
:
maxScore
=
scores
[
pseudo
]
gagnant
=
pseudo
serv
.
privmsg
(
canal
,
"
${0} a gagné avec un score de ${1}
"
.
format
(
gagnant
,
maxScore
))
scores
=
{}
tour
=
0
total
=
0
else
:
datas
=
quizz
()
reponse
=
datas
[
'
reponse
'
].
lower
()
choix
=
datas
[
'
choix
'
]
question
=
datas
[
'
question
'
]
serv
.
privmsg
(
canal
,
"
Question : {0}
"
.
format
(
question
.
format
(
'
utf8
'
)))
serv
.
privmsg
(
canal
,
"
Choix: {0}
"
.
format
(
'
,
'
.
join
(
choix
).
format
(
'
utf8
'
)))
else
:
for
mot
in
pas_reponse
:
if
mot
.
lower
()
in
message
and
personne
not
in
a_repondu
:
serv
.
privmsg
(
canal
,
"
WRONG, {0}
"
.
format
(
personne
))
serv
.
privmsg
(
canal
,
"
WRONG, {0}
"
.
format
(
personne
))
a_repondu
.
append
(
personne
)
a_repondu
.
append
(
personne
)
if
not
is_l_heure_de_manger
()
and
should_ban
(
message
)
:
if
not
is_l_heure_de_manger
()
and
should_ban
(
message
)
:
serv
.
privmsg
(
canal
,
"
PUTAIN ON A DIT NON
"
)
serv
.
privmsg
(
canal
,
"
PUTAIN ON A DIT NON
"
)
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter