diff --git a/vars/lolops.groovy b/vars/lolops.groovy new file mode 100644 index 0000000..c37ff92 --- /dev/null +++ b/vars/lolops.groovy @@ -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]]; +} \ No newline at end of file