Ajout librairie LoLOps

This commit is contained in:
wpetit 2020-03-04 16:51:30 +01:00
parent 81b4a52142
commit 8e2b7a214a
1 changed files with 14 additions and 0 deletions

14
vars/lolops.groovy Normal file
View File

@ -0,0 +1,14 @@
def getRandomDeliveryAttachment(Integer probability = 25) {
def deliveryImages = [
'https://media.giphy.com/media/UtM8DmnahknE4/giphy.gif',
'https://media.giphy.com/media/11VKF3OwuGHzNe/200w_d.gif',
'https://media.giphy.com/media/d5pGYhWb3T1Hyyl8OB/200w_d.gif',
'https://media.giphy.com/media/oTSy3rHigPd9S/giphy.gif'
]
Random rnd = new Random()
if (rnd.nextInt(100) < probability) {
return [];
}
def imageUrl = deliveryImages[rnd.nextInt(deliveryImages.size())]
return [[title: '', imageUrl: imageUrl]];
}