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
Loïc DEFRANCE
PlayBot
Validations
4b1f1713
Valider
4b1f1713
rédigé
Il y a 10 ans
par
Alexandre Morignot
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
!get work with an ID
parent
175a892f
Branches
Branches contenant la validation
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é
lib/commands/get.pm
+32
-25
32 ajouts, 25 suppressions
lib/commands/get.pm
avec
32 ajouts
et
25 suppressions
lib/commands/get.pm
+
32
−
25
Voir le fichier @
4b1f1713
...
@@ -6,6 +6,7 @@ our @EXPORT_OK = qw(exec);
...
@@ -6,6 +6,7 @@ our @EXPORT_OK = qw(exec);
use
strict
;
use
strict
;
use
warnings
;
use
warnings
;
use
Scalar::
Util
qw(looks_like_number)
;
our
$dbh
;
our
$dbh
;
our
$irc
;
our
$irc
;
...
@@ -19,10 +20,17 @@ sub exec {
...
@@ -19,10 +20,17 @@ sub exec {
my
@tags
=
(
$msg
=~
/#?([a-zA-Z0-9_-]+)/g
);
my
@tags
=
(
$msg
=~
/#?([a-zA-Z0-9_-]+)/g
);
my
$content
;
my
$content
;
my
$sth
;
if
(
@tags
)
{
if
(
@tags
)
{
if
(
looks_like_number
(
$tags
[
0
]))
{
$sth
=
$dbh
->
prepare
('
select id, sender, title, url
from playbot
where id = ?
');
$sth
->
execute
(
$tags
[
0
]);
}
else
{
my
$params
=
join
'
,
'
=>
('
?
')
x
@tags
;
my
$params
=
join
'
,
'
=>
('
?
')
x
@tags
;
my
$sth
;
if
(
$all
)
{
if
(
$all
)
{
$sth
=
$dbh
->
prepare
('
select id, sender, title, url
$sth
=
$dbh
->
prepare
('
select id, sender, title, url
...
@@ -48,6 +56,7 @@ sub exec {
...
@@ -48,6 +56,7 @@ sub exec {
limit 1
');
limit 1
');
$sth
->
execute
(
@tags
,
$chan
->
[
0
],
scalar
@tags
);
$sth
->
execute
(
@tags
,
$chan
->
[
0
],
scalar
@tags
);
}
}
}
$content
=
$sth
->
fetch
;
$content
=
$sth
->
fetch
;
...
@@ -57,8 +66,6 @@ sub exec {
...
@@ -57,8 +66,6 @@ sub exec {
}
}
}
}
else
{
else
{
my
$sth
;
if
(
$all
)
{
if
(
$all
)
{
$sth
=
$dbh
->
prepare
('
select id, sender, title, url from playbot
$sth
=
$dbh
->
prepare
('
select id, sender, title, url from playbot
order by rand()
order by rand()
...
@@ -83,7 +90,7 @@ sub exec {
...
@@ -83,7 +90,7 @@ sub exec {
}
}
}
}
my
$sth
=
$dbh
->
prepare
("
select group_concat(tag separator ' ')
$sth
=
$dbh
->
prepare
("
select group_concat(tag separator ' ')
from playbot_tags
from playbot_tags
where id = ? and context = 0
where id = ? and context = 0
group by id
");
group by 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