Ajout librairie LoLOps
This commit is contained in:
parent
81b4a52142
commit
8e2b7a214a
14
vars/lolops.groovy
Normal file
14
vars/lolops.groovy
Normal 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]];
|
||||
}
|
Loading…
Reference in New Issue
Block a user