Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
B
Bot messenger
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
Déploiement
Releases
Registre de conteneurs
Registre de modèles
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
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
Loïc DUBARD
Bot messenger
Validations
6dcad7fe
Valider
6dcad7fe
rédigé
Il y a 5 ans
par
Loïc Wikle DUBARD
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
maps marche, corrections quizz, et autre fixes
parent
f280b90f
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é
bot.py
+9
-5
9 ajouts, 5 suppressions
bot.py
avec
9 ajouts
et
5 suppressions
bot.py
+
9
−
5
Voir le fichier @
6dcad7fe
...
@@ -69,6 +69,8 @@ class Bot(Client):
...
@@ -69,6 +69,8 @@ class Bot(Client):
return
useless
.
genererSujet
()
return
useless
.
genererSujet
()
if
texte
==
'
!haddock
'
:
if
texte
==
'
!haddock
'
:
return
useless
.
haddock
()
return
useless
.
haddock
()
# renomer qqn
if
'
!rename
'
in
texte
:
if
'
!rename
'
in
texte
:
texte
=
texte
.
replace
(
'
!rename
'
,
''
).
split
(
'
;
'
)
texte
=
texte
.
replace
(
'
!rename
'
,
''
).
split
(
'
;
'
)
for
user
in
self
.
fetchAllUsersFromThreads
([
thread_id
]):
for
user
in
self
.
fetchAllUsersFromThreads
([
thread_id
]):
...
@@ -76,6 +78,8 @@ class Bot(Client):
...
@@ -76,6 +78,8 @@ class Bot(Client):
self
.
changeNickname
(
nickname
=
texte
[
1
],
user_id
=
user
.
uid
,
thread_id
=
thread_id
,
thread_type
=
thread_type
)
self
.
changeNickname
(
nickname
=
texte
[
1
],
user_id
=
user
.
uid
,
thread_id
=
thread_id
,
thread_type
=
thread_type
)
else
:
else
:
return
random
.
choice
([
'
T
\'
es sur de ton coup là ?
'
,
'
chais pas qui c
\'
est...
'
])
return
random
.
choice
([
'
T
\'
es sur de ton coup là ?
'
,
'
chais pas qui c
\'
est...
'
])
# pour rigoler
if
any
(
word
.
lower
()
in
texte
.
lower
()
for
word
in
Bot
.
what_liste
):
if
any
(
word
.
lower
()
in
texte
.
lower
()
for
word
in
Bot
.
what_liste
):
return
random
.
choice
(
Bot
.
what_liste
)
return
random
.
choice
(
Bot
.
what_liste
)
if
'
!memes
'
in
texte
:
if
'
!memes
'
in
texte
:
...
@@ -85,8 +89,8 @@ class Bot(Client):
...
@@ -85,8 +89,8 @@ class Bot(Client):
if
any
(
word
.
lower
()
in
texte
.
lower
()
for
word
in
[
"
let
\'
s go
"
,
"
c
'
est parti
"
,
"
go
"
,
"
allons
"
]):
if
any
(
word
.
lower
()
in
texte
.
lower
()
for
word
in
[
"
let
\'
s go
"
,
"
c
'
est parti
"
,
"
go
"
,
"
allons
"
]):
return
'
é zé bardi !
'
return
'
é zé bardi !
'
if
any
(
word
.
lower
()
in
texte
.
lower
()
for
word
in
[
'
noice
'
,
'
nice
'
,
'
ok
'
]):
if
any
(
word
.
lower
()
in
texte
.
lower
()
for
word
in
[
'
noice
'
,
'
nice
'
,
'
ok
'
]):
#
self.send(Message(text="👍", emoji_size=EmojiSize.LARGE), thread_id=thread_id, thread_type=thread_type)
self
.
send
(
Message
(
text
=
"
👍
"
,
emoji_size
=
EmojiSize
.
LARGE
),
thread_id
=
thread_id
,
thread_type
=
thread_type
)
self
.
send
(
Message
(
emoji_size
=
EmojiSize
.
LARGE
),
thread_id
=
thread_id
,
thread_type
=
thread_type
)
#
self.send(Message(emoji_size=EmojiSize.LARGE), thread_id=thread_id, thread_type=thread_type)
if
'
!kohlanta
'
in
texte
:
if
'
!kohlanta
'
in
texte
:
texte
=
texte
.
replace
(
'
!kohlanta
'
,
''
)
texte
=
texte
.
replace
(
'
!kohlanta
'
,
''
)
return
useless
.
kohlanta
(
texte
,
channel
)
return
useless
.
kohlanta
(
texte
,
channel
)
...
@@ -112,14 +116,14 @@ class Bot(Client):
...
@@ -112,14 +116,14 @@ class Bot(Client):
return
quizz
.
scoreboard
()
return
quizz
.
scoreboard
()
if
'
reset
'
in
texte
:
if
'
reset
'
in
texte
:
return
quizz
.
reset
()
return
quizz
.
reset
()
if
'
indice
'
in
quizz
:
if
'
indice
'
in
texte
:
return
quizz
.
indice
()
return
quizz
.
indice
()
if
'
round
'
in
texte
:
if
'
round
'
in
texte
:
return
quizz
.
get_round
()
return
quizz
.
get_round
()
if
'
question
'
in
texte
:
if
'
question
'
in
texte
:
return
quizz
.
get_question
()
return
quizz
.
get_question
()
if
'
!q
'
in
texte
:
if
'
!q
'
in
texte
:
return
quizz
.
answer
(
text
.
replace
(
'
!q
'
,
''
),
self
.
fetchUserInfo
(
author_id
)[
author_id
].
name
)
return
quizz
.
answer
(
text
e
.
replace
(
'
!q
'
,
''
),
self
.
fetchUserInfo
(
author_id
)[
author_id
].
name
)
# meteo
# meteo
if
'
!meteo
'
in
texte
:
if
'
!meteo
'
in
texte
:
...
@@ -141,7 +145,7 @@ class Bot(Client):
...
@@ -141,7 +145,7 @@ class Bot(Client):
return
'
Ousp, j
\'
ai glissé chef...
'
return
'
Ousp, j
\'
ai glissé chef...
'
if
'
!maps
'
in
texte
:
if
'
!maps
'
in
texte
:
try
:
try
:
usefull
.
maps
(
texte
.
replace
(
'
!maps
'
,
''
))
return
usefull
.
maps
(
texte
.
replace
(
'
!maps
'
,
''
))
except
:
except
:
return
'
Houston, on a un problème...
'
return
'
Houston, on a un problème...
'
if
texte
==
'
!about
'
:
if
texte
==
'
!about
'
:
...
...
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