(arr, count = 1)
| 34 | wallhp: 'https://raw.githubusercontent.com/GlobalTechInfo/GLOBAL-XMD/master/src/media/randompics/wallhp.json', |
| 35 | }; |
| 36 | function pickRandom(arr, count = 1) { |
| 37 | const result = []; |
| 38 | const copy = [...arr]; |
| 39 | for (let i = 0; i < count; i++) { |
| 40 | if (copy.length === 0) |
| 41 | break; |
| 42 | const index = Math.floor(Math.random() * copy.length); |
| 43 | result.push(copy.splice(index, 1)[0]); |
| 44 | } |
| 45 | return result; |
| 46 | } |
| 47 | export default { |
| 48 | command: 'images', |
| 49 | aliases: ['wallpics', 'pics'], |