Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
P
PlayBot
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
Déploiement
Releases
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
Alexandre MORIGNOT
PlayBot
Validations
3aeed0af
Valider
3aeed0af
rédigé
16 août 2014
par
Alexandre Morignot
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
a !get stores the content in the history like a post
parent
84c95ae5
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
lib/commands/get.pm
+11
-1
11 ajouts, 1 suppression
lib/commands/get.pm
lib/commands/parser.pm
+2
-1
2 ajouts, 1 suppression
lib/commands/parser.pm
avec
13 ajouts
et
2 suppressions
lib/commands/get.pm
+
11
−
1
Voir le fichier @
3aeed0af
...
@@ -10,9 +10,10 @@ use Scalar::Util qw(looks_like_number);
...
@@ -10,9 +10,10 @@ use Scalar::Util qw(looks_like_number);
our
$dbh
;
our
$dbh
;
our
$irc
;
our
$irc
;
our
$log
;
sub
exec
{
sub
exec
{
my
(
$kernel
,
$
user
,
$chan
,
$msg
)
=
@_
;
my
(
$kernel
,
$
nick
,
$chan
,
$msg
)
=
@_
;
# if we are in a query or arg -all, we search in all the channels
# if we are in a query or arg -all, we search in all the channels
my
$all
=
0
;
my
$all
=
0
;
...
@@ -141,6 +142,15 @@ sub exec {
...
@@ -141,6 +142,15 @@ sub exec {
$irc
->
yield
(
privmsg
=>
$chan
=>
'
[
'
.
$content
->
[
0
]
.
'
]
'
.
$content
->
[
2
]
.
'
=>
'
.
$content
->
[
3
]
.
'
'
.
$tags
)
;
$irc
->
yield
(
privmsg
=>
$chan
=>
'
[
'
.
$content
->
[
0
]
.
'
]
'
.
$content
->
[
2
]
.
'
=>
'
.
$content
->
[
3
]
.
'
'
.
$tags
)
;
}
}
# we save the get like a post
my
$sth2
=
$dbh
->
prepare_cached
('
INSERT INTO playbot_chan (content, chan, sender_irc)
VALUES (?,?,?)
');
$log
->
error
("
Couldn't prepare querie; aborting
")
unless
(
defined
$sth2
);
$sth2
->
execute
(
$content
->
[
0
],
$chan
->
[
0
],
$nick
)
or
$log
->
error
("
Couldn't finish transaction:
"
.
$dbh
->
errstr
);
return
$content
->
[
0
];
return
$content
->
[
0
];
}
}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
lib/commands/parser.pm
+
2
−
1
Voir le fichier @
3aeed0af
...
@@ -25,6 +25,7 @@ sub setConf {
...
@@ -25,6 +25,7 @@ sub setConf {
$
commands::fav::
log
=
$log
;
$
commands::fav::
log
=
$log
;
$
commands::tag::
log
=
$log
;
$
commands::tag::
log
=
$log
;
$
commands::get::
log
=
$log
;
$
commands::later::
log
=
$log
;
$
commands::later::
log
=
$log
;
$
commands::fav::
irc
=
$ircNew
;
$
commands::fav::
irc
=
$ircNew
;
...
@@ -64,7 +65,7 @@ sub exec {
...
@@ -64,7 +65,7 @@ sub exec {
}
}
elsif
(
$msg
=~
/^( *!get)(?: +.*)?$/
)
{
elsif
(
$msg
=~
/^( *!get)(?: +.*)?$/
)
{
$msg
=
substr
$msg
,
(
length
$
1
)
+
1
;
$msg
=
substr
$msg
,
(
length
$
1
)
+
1
;
my
@args
=
(
$kernel
,
$
user
,
$chan
,
$msg
);
my
@args
=
(
$kernel
,
$
nick
,
$chan
,
$msg
);
my
$id
=
commands::get::
exec
(
@args
);
my
$id
=
commands::get::
exec
(
@args
);
if
(
$id
)
{
if
(
$id
)
{
...
...
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