@skyhelperbot/utils 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{emojis as
|
|
2
|
-
`)}}function ae(s,e,t){return{type:c.Thumbnail,media:{url:s},description:e,spoiler:t}}function se(s,e){return{...e,media:{url:s,...e?.media}}}function ne(s,...e){let t=Array.isArray(s)?s:[s];return t.push(...e),{type:c.MediaGallery,items:t}}function re(s=!0,e=2){return{type:c.Separator,divider:s,spacing:e}}function ie(s,e,...t){return{type:c.Section,accessory:s,components:[O(e,...t)]}}function oe(s,e){return{type:c.File,file:{url:s},spoiler:e}}function de(s,...e){let t=Array.isArray(s)?s:[s];return t.push(...e),{type:c.ActionRow,components:t}}function me(s={}){return{type:c.Button,style:2,custom_id:"button",...s}}import{OverwriteType as N,PermissionFlagsBits as b}from"discord-api-types/v10";var T=class s{constructor(e=0n){this.perms=e;this.bitfield=this.resolveBitFields(e)}bitfield;get flags(){return this.resolveBitFlags(this.bitfield)}resolveBitFields=s.resolveBits.bind(s);resolveBitFlags=s.resolveFlags.bind(s);static resolveBits(e){if(typeof e=="bigint"&&e>0n)return e;if(Array.isArray(e))return e.map(this.resolveBits.bind(this)).reduce((t,a)=>t|a,0n);if(typeof e=="string"){if(!Number.isNaN(parseInt(e)))return BigInt(e);if(b[e]!==void 0)return b[e]}return console.warn("Recieved Unknown Permissions: ",e),0n}static resolveFlags(e){let t=[];for(let[a,n]of Object.entries(b))e&n&&t.push(a);return t}has(e){let t=this.resolveBitFields(e);return(this.bitfield&t)===t}remove(e){let t=this.resolveBitFields(e);return this.bitfield&=~t,this}add(e){let t=this.resolveBitFields(e);return this.bitfield|=t,this}missing(e){let a=this.resolveBitFields(e)&~this.bitfield;return this.resolveBitFlags(a)}static overwriteFor(e,t,a){let n="permissions"in e,r=this.permissionsFor(e,a);if(!n&&a.owner_id===e.user.id)return this.all();if(r.has("Administrator"))return this.all();let d=t.permission_overwrites.find(i=>i.id===t.guild_id);if(n){let i=new s(e.permissions),u=t.permission_overwrites.find(_=>_.id===e.id);return d&&i.remove(d.deny).add(d.allow),u&&i.remove(u.deny).add(u.allow),i}let m=t.permission_overwrites.map(i=>i.type===N.Role&&e.roles.includes(i.id)&&i).filter(i=>i!==!1),l=t.permission_overwrites.find(i=>i.id===e.user.id);return d&&r.remove(d.deny).add(d.allow),m.length&&(r.remove(this.resolveBits(m.map(i=>i.deny))),r.add(this.resolveBits(m.map(i=>i.allow)))),l&&r.remove(l.deny).add(l.allow),r}static permissionsFor(e,t){let a="position"in e;if(!a&&t.owner_id===e.user.id)return this.all();let n=new s(a?e.permissions:e.roles.map(r=>{let d=t.roles.find(l=>l.id===r);if(!d)throw new Error("Role not found");let m=t.roles.find(l=>l.id===t.id);return BigInt(d.permissions)|BigInt(m.permissions)}));return n.has("Administrator")?this.all():n}static all(){let e=Object.values(b).reduce((t,a)=>t|a,0n);return new s(e)}toArray(){return this.flags}};import{DateTime as w}from"luxon";import{zone as D}from"@skyhelperbot/constants";function fe(){let s=w.fromISO("2025-11-20",{zone:D}).startOf("day"),e=w.now().setZone(D),t=s.plus({days:3}).endOf("day"),a=t;for(;e>a;)a=a.plus({days:14});let n=a.minus({days:3}).startOf("day");if(e<n){let r=n.diffNow(["days","hours","minutes","seconds"]).toFormat("d'd' h'h' m'm' s's'");if(n>s)return{visiting:!1,nextVisit:n,duration:r};if(n.equals(s))return{visiting:!1,nextVisit:n,duration:r}}if(e>=n&&e<=a){let r=a.diffNow(["days","hours","minutes","seconds"]).toFormat("d'd' h'h' m'm' s's'");if(t<a)return{visiting:!0,nextVisit:n,duration:r};if(s.equals(a))return{visiting:!0,nextVisit:n,duration:r}}}function be(s,e=8){let t=Math.round(s/100*e),a="";for(let n=0;n<e;n++){let r=n<t;n===0?a+=r?`<:_:${f.progress_filled_start}>`:`<:_:${f.progress_empty_start}>`:n===e-1?a+=r?`<:_:${f.progress_filled_end}>`:`<:_:${f.progress_empty_end}>`:a+=r?`<:_:${f.progress_filled_middle}>`:`<:_:${f.progress_empty_middle}>`}return`${a} ${s}%`}import{DateTime as g}from"luxon";var A=s=>{let e=(t,a,n,r,d,m,l,i,u,_,F)=>({earlySky:s.startOf("day").plus({hours:t,minutes:a,seconds:n}),gateShard:s.startOf("day").plus({hours:r,minutes:d}),start:s.startOf("day").plus({hours:m,minutes:l,seconds:i}),end:s.startOf("day").plus({hours:u,minutes:_}),shardMusic:F});return{C:[e(7,7,50,7,40,7,48,40,11,40,"Lights Afar"),e(13,7,50,13,40,13,48,40,17,40,"Lights Afar"),e(19,7,50,19,40,19,48,40,23,40,"Lights Afar")],b:[e(1,37,50,2,10,2,18,40,6,10,"An Abrupt Premonition"),e(9,37,50,10,10,10,18,40,14,10,"An Abrupt Premonition"),e(17,37,50,18,10,18,18,40,22,10,"An Abrupt Premonition")],A:[e(1,47,50,2,20,2,28,40,6,20,"Lights Afar"),e(7,47,50,8,20,8,28,40,12,20,"Lights Afar"),e(13,47,50,14,20,14,28,40,18,20,"Lights Afar")],a:[e(1,17,50,1,50,1,58,40,5,50,"An Abrupt Premonition"),e(9,17,50,9,50,9,58,40,13,50,"An Abrupt Premonition"),e(17,17,50,17,50,17,58,40,21,50,"An Abrupt Premonition")],B:[e(2,57,50,3,30,3,38,40,7,30,"Of The Essence"),e(8,57,50,9,30,9,38,40,13,30,"Of The Essence"),e(14,57,50,15,30,15,38,40,19,30,"Of The Essence")]}};var o={a:{type:"black",colors:"#000000",weekdays:[6,7]},A:{type:"red",colors:"#FF0000",weekdays:[2,3]},b:{type:"black",colors:"#000000",weekdays:[7,1]},B:{type:"red",colors:"#FF0000",weekdays:[3,4]},C:{type:"red",colors:"#FF0000",weekdays:[1,2]}},I={prairie:{a:{area:"Butterfly Fields, <:r5Prairie:1150596314883690607> Daylight Prairie",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226741731119165/ButterflyFields.png",...o.a,location:"https://media.discordapp.net/attachments/575827924343848960/1119162577126178846/01_Daylight_Prairie_-_Butterfly_Field.png",data:"https://media.discordapp.net/attachments/575827924343848960/1053249686422687784/dp-b_Butterfly_Field.png"},A:{area:"Bird's Nest, <:r5Prairie:1150596314883690607> Daylight Prairie",ac:2.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226742024708187/BirdsNest.png",...o.A,location:"https://media.discordapp.net/attachments/575827924343848960/1109738791268257812/01_Daylight_Prairie_-_Birds_Nest.png",data:"https://media.discordapp.net/attachments/575827924343848960/1044197796577824839/dp-r_Bird_Nest.png"},b:{area:"Village Island, <:r5Prairie:1150596314883690607> Daylight Prairie",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226741412343989/VillageIsland.png",...o.b,location:"https://media.discordapp.net/attachments/575827924343848960/1115536957875945604/01_Daylight_Prairie_-_Village_Islands_and_Koi_Pond.png",data:"https://media.discordapp.net/attachments/575827924343848960/1049635543421550652/dp-b_Village-Koi.png"},B:{area:"Sanctuary Island, <:r5Prairie:1150596314883690607> Daylight Prairie",ac:3.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226740741263510/SanctuaryIsland.png",...o.B,location:"https://media.discordapp.net/attachments/575827924343848960/1117348946390564934/IMG_4458.png",data:"https://media.discordapp.net/attachments/575827924343848960/1051464559065583637/dp-r_Sanctuary_Islands.png"},C:{area:"Prairie Caves, <:r5Prairie:1150596314883690607> Daylight Prairie",ac:2,image:"https://media.discordapp.net/attachments/867638574571323424/1159226741110349925/PrairieCave.png",...o.C,location:"https://media.discordapp.net/attachments/575827924343848960/1124597919178313749/01_Daylight_Prairie_-_Prairie_Caves.png",data:"https://media.discordapp.net/attachments/1123347180988661902/1126113425286766702/dp-r_Caves.jpg"}},forest:{a:{area:"Forest Brook, <:r4Forest:1150596343354630235> Hidden Forest",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226847062671400/ForestBrook.png",...o.a,location:"https://media.discordapp.net/attachments/575827924343848960/1117712849217781871/IMG_3543.png",data:"https://media.discordapp.net/attachments/575827924343848960/1051802895634399242/hf-b_Forest_Brook.png"},A:{area:"Treehouse, <:r4Forest:1150596343354630235> Hidden Forest",ac:3.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226739713650788/Treehouse.png",...o.A,location:"https://media.discordapp.net/attachments/575827924343848960/1111912764420665394/02_Hidden_Forest_-_Assembly_Treehouse.png",data:"https://media.discordapp.net/attachments/575827924343848960/1046371999586451597/png_20221027_180854_0000.png"},b:{area:"Boneyard, <:r4Forest:1150596343354630235> Hidden Forest",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226740472819793/Boneyard.png",...o.b,location:"https://media.discordapp.net/attachments/575827924343848960/1121336759633059890/02_Hidden_Forest_-_Broken_Bridge.png",data:"https://media.discordapp.net/attachments/575827924343848960/1048189111145603072/hf-b_Boneyard.png"},B:{area:"Sunny Forest, <:r4Forest:1150596343354630235> Hidden Forest",ac:3.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226659518558298/ElevatedClearing.png",...o.B,location:"https://media.discordapp.net/attachments/575827924343848960/1119522919983349780/02_Hidden_Forest_-_Elevated_Clearing.png",data:"https://media.discordapp.net/attachments/575827924343848960/1053645676870897724/hf-r_Elevated_Clearing.png"},C:{area:"Forest End, <:r4Forest:1150596343354630235> Hidden Forest",ac:2.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226740099534868/ForestEnd.png",...o.C,location:"https://media.discordapp.net/attachments/575827924343848960/1115899669847998526/02_Hidden_Forest_-_Forest_End.png",data:"https://media.discordapp.net/attachments/575827924343848960/1050078656015376496/hf-r_Forest_End.png"}},valley:{a:{area:"Ice Rink, <:r3Valley:1150596376930037850> Valley of Triumph",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226659262693446/IceRink.png",...o.a,location:"https://media.discordapp.net/attachments/575827924343848960/1116263531101306940/03_Valley_of_Triumph_-_Ice_Rink.png",data:"https://media.discordapp.net/attachments/575827924343848960/1050351219383730186/vt-b_Ice_Rink.png"},A:{area:"Village of Dreams, <:r3Valley:1150596376930037850> Valley of Triumph",ac:2.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226658918780948/VillageOfDreams.png",...o.A,location:"https://media.discordapp.net/attachments/575827924343848960/1114449712070799360/03_Valley_of_Triumph_-_Village_of_Dreams.png",data:"https://media.discordapp.net/attachments/575827924343848960/1048546903702384721/vt-r_Village_of_Dreams.png"},b:{area:"Ice Rink, <:r3Valley:1150596376930037850> Valley of Triumph",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226659262693446/IceRink.png",...o.b,location:"https://media.discordapp.net/attachments/575827924343848960/1116263531101306940/03_Valley_of_Triumph_-_Ice_Rink.png",data:"https://media.discordapp.net/attachments/575827924343848960/1050351219383730186/vt-b_Ice_Rink.png"},B:{area:"Hermit's Valley, <:r3Valley:1150596376930037850> Valley of Triumph",ac:3.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226658629365770/HermitsValley.png",...o.B,location:"https://media.discordapp.net/attachments/575827924343848960/1110464646911115314/03_Valley_of_Triumph_-_Hermit_Valley.png",data:"https://media.discordapp.net/attachments/575827924343848960/1055814361026936952/vt-r_Hermit_Valley.png"},C:{area:"Village of Dreams, <:r3Valley:1150596376930037850> Valley of Triumph",ac:2.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226658918780948/VillageOfDreams.png",...o.C,location:"https://media.discordapp.net/attachments/575827924343848960/1114449712070799360/03_Valley_of_Triumph_-_Village_of_Dreams.png",data:"https://media.discordapp.net/attachments/575827924343848960/1048546903702384721/vt-r_Village_of_Dreams.png"}},wasteland:{a:{area:"Broken Temple, <:r2Wasteland:1150596423822356511> Golden Wasteland",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226658209923202/BrokenTemple.png",...o.a,location:"https://media.discordapp.net/attachments/575827924343848960/1125685677384806531/04_Golden_Wasteland_-_Broken_Temple.png",data:"https://media.discordapp.net/attachments/575827924343848960/1045297714474254396/gw-b_Broken_Temple.png"},A:{area:"Crab Fields, <:r2Wasteland:1150596423822356511> Golden Wasteland",ac:2.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226846794231919/CrabFields.png",...o.A,location:"https://media.discordapp.net/attachments/575827924343848960/1094518173262417990/04_Golden_Wasteland_-_Crab_Fields.png",data:"https://media.discordapp.net/attachments/575827924343848960/1050722076681568256/gw-r_Shipwreck.png"},b:{area:"Battlefield, <:r2Wasteland:1150596423822356511> Golden Wasteland",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226657148784680/Battlefield.png",...o.b,location:"https://media.discordapp.net/attachments/575827924343848960/1118435910615302164/04_Golden_Wasteland_-_Battlefield.png",data:"https://media.discordapp.net/attachments/575827924343848960/1052530499668688957/gw-b_Battlefield.png"},B:{area:"Forgotten Ark, <:r2Wasteland:1150596423822356511> Golden Wasteland",ac:3.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226657933119508/ForgottenArk.png",...o.B,location:"https://media.discordapp.net/attachments/575827924343848960/1112639178048548884/IMG_3148.png",data:"https://media.discordapp.net/attachments/575827924343848960/1069221627918827622/Forgotten_Ark_1.png"},C:{area:"Graveyard, <:r2Wasteland:1150596423822356511> Golden Wasteland",ac:2,image:"https://media.discordapp.net/attachments/867638574571323424/1159226742263787623/Graveyard.png",...o.C,location:"https://media.discordapp.net/attachments/575827924343848960/1109015846753419294/04_Golden_Wasteland_-_Graveyard.png",data:"https://media.discordapp.net/attachments/575827924343848960/1043553879289253919/gw-r_Graveyard.png"}},vault:{a:{area:"Starlight Desert, <:r1Vault:1150596447679553636> Vault of Knowledge",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226657656287392/StarlightDesert.png",...o.a,location:"https://media.discordapp.net/attachments/575827924343848960/1090896818604347392/IMG_1525.png",data:"https://media.discordapp.net/attachments/575827924343848960/1077178980051984455/vk-b_Starlight_Desert.png"},A:{area:"Jellyfish Cove, Starlight Desert, <:r1Vault:1150596447679553636> Vault of Knowledge",ac:3.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226657404616756/JellyfishCove.png",...o.A,location:"https://media.discordapp.net/attachments/575827924343848960/1089082330305544242/05_Vault_of_Knowledge_-_Jellyfish_Cove.png",data:"https://media.discordapp.net/attachments/575827924343848960/1049290746190106694/vk-r_Starlight_Desert.png"},b:{area:"Starlight Desert, <:r1Vault:1150596447679553636> Vault of Knowledge",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226657656287392/StarlightDesert.png",...o.b,location:"https://media.discordapp.net/attachments/575827924343848960/1090896818604347392/IMG_1525.png",data:"https://media.discordapp.net/attachments/575827924343848960/1077178980051984455/vk-b_Starlight_Desert.png"},B:{area:"Jellyfish Cove, Starlight Desert, <:r1Vault:1150596447679553636> Vault of Knowledge",ac:3.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226657404616756/JellyfishCove.png",...o.B,location:"https://media.discordapp.net/attachments/575827924343848960/1089082330305544242/05_Vault_of_Knowledge_-_Jellyfish_Cove.png",data:"https://media.discordapp.net/attachments/575827924343848960/1049290746190106694/vk-r_Starlight_Desert.png"},C:{area:"Jellyfish Cove, Starlight Desert, <:r1Vault:1150596447679553636> Vault of Knowledge",ac:3.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226657404616756/JellyfishCove.png",...o.C,location:"https://media.discordapp.net/attachments/575827924343848960/1089082330305544242/05_Vault_of_Knowledge_-_Jellyfish_Cove.png",data:"https://media.discordapp.net/attachments/575827924343848960/1049290746190106694/vk-r_Starlight_Desert.png"}}};var p=s=>s*60,h={geyser:{name:"Geyser",index:0,duration:15,offset:0,infographic:{by:"Clement",image:"https://media.discordapp.net/attachments/867638574571323424/1252998364941914243/Visit_Geyser_Clement.png?ex=66744129&is=6672efa9&hm=8d76d1767aca362d23547b1e3beb2b610f58e4fbec24b12af56fdc745f7074e8&"},displayAllTimes:!0,interval:p(2)},grandma:{name:"Grandma",index:1,duration:15,offset:30,infographic:{by:"Clement",image:"https://media.discordapp.net/attachments/867638574571323424/1252998366288416849/Visit_Grandma_Clement.png?ex=6674412a&is=6672efaa&hm=7228b695ec7008204fede2f3d6b4864a06a7cfa25a14ab4d7572957ee940044c&"},displayAllTimes:!0,interval:p(2)},turtle:{name:"Turtle",index:2,duration:10,offset:50,infographic:{by:"Velvet",image:"https://media.discordapp.net/attachments/867638574571323424/1252998363205472316/Visit_Turtle_Velvet.jpg?ex=66744129&is=6672efa9&hm=8c189ff8501fc88810606b832addbea8a9a81eb7a7a6b17019ff1ced593e1ae8&"},displayAllTimes:!0,interval:p(2)},"daily-reset":{name:"Daily Reset",index:3,offset:0,interval:p(24)},eden:{name:"Eden/Weekly Reset",index:4,offset:0,interval:p(168),occursOn:{weekDays:[7]}},aurora:{name:"Aurora's concert",index:5,offset:0,duration:50,displayAllTimes:!0,interval:p(2)},"dream-skater":{name:"Dream Skater",index:6,duration:15,displayAllTimes:!0,occursOn:{weekDays:[5,6,7]},offset:p(1),interval:p(2)},"passage-quests":{name:"Passage Quests",index:7,offset:0,displayAllTimes:!0,interval:15},"nest-sunset":{name:"Nest Sunset",index:8,offset:40,displayAllTimes:!0,interval:p(1)},"fireworks-festival":{name:"Fireworks Festival",index:9,offset:0,duration:10,displayAllTimes:!0,interval:p(4),occursOn:{dayOfTheMonth:1}},"fairy-ring":{name:"Fairy Ring",index:11,offset:50,displayAllTimes:!0,interval:60},"brook-rainbow":{name:"Forest Brook Rainbow",index:12,displayAllTimes:!0,offset:p(5),interval:p(12)}};import{CDNRoutes as Oe}from"discord-api-types/v10";function P(s,e){let t=[],a=s.startOf("day"),n=e.startOf("day");for(;a<=n;)t.push(a),a=a.plus({days:1});return t}import{zone as $}from"@skyhelperbot/constants";var C=["C","b","A","a","B","b","C","a","A","b","B","a"],k=["prairie","forest","valley","wasteland","vault"],S=class{static getDate(e){let t="America/Los_Angeles",a;try{if(e){let[n,r,d]=e.split("-").map(Number);a=g.fromObject({year:n,month:r,day:d},{zone:t}).startOf("day")}else a=g.now().setZone(t).startOf("day");return a.isValid?a:"invalid"}catch(n){throw new Error(n)}}static shardsIndex(e){let t=e.day,a=(t-1)%C.length,n=C[a],r=(t-1)%k.length,d=k[r];return{currentShard:n,currentRealm:d}}static getSuffix(e){let t=["th","st","nd","rd"],a=e%10,n=e%100;return t[a===1&&n!==11?1:a===2&&n!==12?2:a===3&&n!==13?3:0]}static getStatus(e){let t="America/Los_Angeles",{currentShard:a}=this.shardsIndex(e),n=A(e)[a],r=g.now().setZone(t);if(o[a].weekdays.includes(e.weekday))return"No Shard";let m=[];for(let l=0;l<n.length;l++){let i=n[l];if(r>=i.start&&r<=i.end){m.push({index:l+1,active:!0,start:i.start,end:i.end,duration:i.end.diff(r,["days","hours","minutes","seconds"]).toFormat("dd'd' hh'h' mm'm' ss's'")});continue}else if(r<i.start){m.push({index:l+1,active:!1,start:i.start,end:i.end,duration:i.start.diff(r,["days","hours","minutes","seconds"]).toFormat("dd'd' hh'h' mm'm' ss's'")});continue}else if(r>i.end){m.push({index:l+1,ended:!0,start:i.start,end:i.end,duration:r.diff(i.end,["days","hours","minutes","seconds"]).toFormat("dd'd' hh'h' mm'm' ss's'")});continue}}return m}static getShard(e){let{currentRealm:t,currentShard:a}=this.shardsIndex(e),n=I[t][a];if(o[a].weekdays.includes(e.weekday))return null;let d=A(e)[a];return{info:n,timings:d}}static getNextShard(e,t){let a=this.getShard(e);if(!a||t&&!t.some(n=>a.info.type.toLowerCase().includes(n)))return null;for(let[n,r]of a.timings.entries())if(e<=r.start)return{index:n+1,start:r.start,end:r.end,duration:r.start.diff(e,["days","hours","minutes","seconds"]).toFormat("dd'd' hh'h' mm'm' ss's'"),info:a.info};return null}static getNextShardFromNow(e){let t=g.now().setZone("America/Los_Angeles"),a=this.getNextShard(t,e);for(;!a;)t=t.plus({days:1}).startOf("day"),a=this.getNextShard(t,e);return a}static getShardsBetween(e=g.now().setZone($),t){let a=P(e,t),n=[];for(let r of a)n.push({date:r,shard:this.getNextShard(r)});return n}};import{DateTime as x}from"luxon";var M=class{static getAllTimes(e,t){let a=e,n=[];for(;e.hasSame(a,"day");)n.push(`<t:${a.toUnixInteger()}:t>`),a=a.plus({minutes:t??0});return n.join(" \u2022 ")}static getOccurrenceDay(e){let t=x.now().setZone("America/Los_Angeles").startOf("day").plus({minutes:e.offset});if(e.occursOn){if(e.occursOn.weekDays)for(;!e.occursOn.weekDays.includes(t.weekday);)t=t.plus({days:1});if(e.occursOn.dayOfTheMonth)for(;t.day!==e.occursOn.dayOfTheMonth;)t=t.plus({days:1})}return t}static getNextEventOccurrence(e){let t=h[e];if(!t)throw new Error("Unknown Event");let a=x.now().setZone("America/Los_Angeles"),n=this.getOccurrenceDay(t);for(;n<a;)n=n.plus({minutes:t.interval??0});return n}static getEventDetails(e){let t=this.getNextEventOccurrence(e);return{event:h[e],nextOccurence:t,allOccurences:this.getAllTimes(this.getOccurrenceDay(h[e]),h[e].interval),status:this.getEventStatus(h[e],t)}}static allEventDetails(){let e=Object.keys(h).sort((a,n)=>h[a].index-h[n].index),t=[];for(let a of e)t.push([a,this.getEventDetails(a)]);return t}static getEventStatus(e,t){let a=x.now().setZone("America/Los_Angeles"),n={active:!1,nextTime:t,duration:t.diff(a).toFormat("d'd' h'h' m'm' s's'")};if(!e.duration)return n;let r=t.minus({minutes:e.interval??0}),d=r.plus({minutes:e.duration});return a>=r&&a<=d?{active:!0,startTime:r,endTime:d,nextTime:t,duration:d.diff(a).toFormat("d'd' h'h' m'm' s's'")}:n}};export{T as PermissionsUtil,S as ShardsUtil,M as SkytimesUtils,me as button,te as container,be as createEmojiProgressBar,h as eventData,oe as file,fe as getNextTs,ne as mediaGallery,se as mediaGalleryItem,Z as parseDateFormat,j as parsePerms,U as postToHaste,H as recursiveReadDir,Q as resolveColor,de as row,ie as section,re as separator,o as shardConfig,I as shardsInfo,A as shardsTimeline,O as textDisplay,ae as thumbnail};
|
|
1
|
+
import{emojis as u}from"@skyhelperbot/constants";import{request as F}from"undici";var O=async n=>{let e=await F("https://hst.sh/documents/",{method:"POST",body:typeof n=="object"?JSON.stringify(n,null,2):n});if(e.statusCode!==200)throw new Error("Status code did not return 200, something went wrong.");return`https://hst.sh/${(await e.body.json()).key}.javascript`};var x={AddReactions:"Add Reactions",Administrator:"Administrator",AttachFiles:"Attach Files",BanMembers:"Ban Members",ChangeNickname:"Change Nickname",Connect:"Connect",CreateInstantInvite:"Create Instant Invite",CreatePrivateThreads:"Create Private Threads",CreatePublicThreads:"Create Public Threads",DeafenMembers:"Deafen Members",EmbedLinks:"Embed Links",KickMembers:"Kick Members",ManageChannels:"Manage Channels",ManageEmojisAndStickers:"Manage Emojis and Stickers",ManageGuildExpressions:"Manage Expressions",ManageEvents:"Manage Events",ManageGuild:"Manage Server",ManageMessages:"Manage Message",ManageNicknames:"Manage Nicknames",ManageRoles:"Manage Roles",ManageThreads:"Manage Threads",ManageWebhooks:"Manage Webhooks",MentionEveryone:"Mention Everyone",ModerateMembers:"Moderate Members",MoveMembers:"Move Members",MuteMembers:"Mute Members",PrioritySpeaker:"Priority Speaker",ReadMessageHistory:"Read Message History",RequestToSpeak:"Request to Speak",SendMessages:"Send messages",SendMessagesInThreads:"Send Messages In Threads",SendTTSMessages:"Send TTS messages",Speak:"Speak",Stream:"Video",UseApplicationCommands:"Use Application Commands",UseEmbeddedActivities:"Use Embedded Activities",UseExternalEmojis:"Use External Emojis",UseExternalStickers:"Use External Stickers",UseVAD:"Use Voice Activity",ViewAuditLog:"View Audit Log",ViewChannel:"View Channel",ViewGuildInsights:"View Server Insights"},$=n=>Array.isArray(n)?n.map(e=>`\`${x[e]}\` `).join(", "):`\`${x[n]}\``;var U=n=>{let e=[{regex:/^\d{2}-\d{2}-\d{4}$/,format:"DD-MM-YYYY"},{regex:/^\d{2}\/\d{2}\/\d{4}$/,format:"DD/MM/YYYY"},{regex:/^\d{4}-\d{2}-\d{2}$/,format:"YYYY-MM-DD"},{regex:/^\d{4}\/\d{2}\/\d{2}$/,format:"YYYY/MM/DD"},{regex:/^\d{1,2}-\d{1,2}-\d{4}$/,format:"D-M-YYYY"},{regex:/^\d{1,2}\/\d{1,2}\/\d{4}$/,format:"D/M/YYYY"},{regex:/^[A-Za-z]+\s\d{1,2},\s\d{4}$/,format:"Month DD, YYYY"}];for(let{regex:t,format:a}of e)if(t.test(n))return a;return null};function W(n){let e;if(typeof n=="string"){if(n==="Random")return Math.floor(Math.random()*16777216);if(n==="Default")return 0;if(/^#?[\da-f]{6}$/i.test(n))return parseInt(n.replace("#",""),16);e=B[n]}else Array.isArray(n)?e=(n[0]<<16)+(n[1]<<8)+n[2]:e=n;if(!Number.isInteger(e))throw new Error("Not a number");if(e<0||e>16777215)throw new Error("Not in color range");return e}var B={Default:0,White:16777215,Aqua:1752220,Green:5763719,Blue:3447003,Yellow:16705372,Purple:10181046,LuminousVividPink:15277667,Fuchsia:15418782,Gold:15844367,Orange:15105570,Red:15548997,Grey:9807270,Navy:3426654,DarkAqua:1146986,DarkGreen:2067276,DarkBlue:2123412,DarkPurple:7419530,DarkVividPink:11342935,DarkGold:12745742,DarkOrange:11027200,DarkRed:10038562,DarkGrey:9936031,DarkerGrey:8359053,LightGrey:12370112,DarkNavy:2899536,Blurple:5793266,Greyple:10070709,DarkButNotBlack:2895667,NotQuiteBlack:2303786};import{ComponentType as c}from"discord-api-types/v10";function q(n,...e){let t=Array.isArray(n)?n:[n];return t.push(...e),{type:c.Container,components:t}}function V(n,...e){return{type:c.TextDisplay,content:[n,...e].join(`
|
|
2
|
+
`)}}function H(n,e,t){return{type:c.Thumbnail,media:{url:n},description:e,spoiler:t}}function J(n,e){return{...e,media:{url:n,...e?.media}}}function Z(n,...e){let t=Array.isArray(n)?n:[n];return t.push(...e),{type:c.MediaGallery,items:t}}function z(n=!0,e=2){return{type:c.Separator,divider:n,spacing:e}}function Q(n,e,...t){return{type:c.Section,accessory:n,components:[V(e,...t)]}}function X(n,e){return{type:c.File,file:{url:n},spoiler:e}}function ee(n,...e){let t=Array.isArray(n)?n:[n];return t.push(...e),{type:c.ActionRow,components:t}}function te(n={}){return{type:c.Button,style:2,custom_id:"button",...n}}import{OverwriteType as E,PermissionFlagsBits as y}from"discord-api-types/v10";var v=class n{constructor(e=0n){this.perms=e;this.bitfield=this.resolveBitFields(e)}bitfield;get flags(){return this.resolveBitFlags(this.bitfield)}resolveBitFields=n.resolveBits.bind(n);resolveBitFlags=n.resolveFlags.bind(n);static resolveBits(e){if(typeof e=="bigint"&&e>0n)return e;if(Array.isArray(e))return e.map(this.resolveBits.bind(this)).reduce((t,a)=>t|a,0n);if(typeof e=="string"){if(!Number.isNaN(parseInt(e)))return BigInt(e);if(y[e]!==void 0)return y[e]}return console.warn("Recieved Unknown Permissions: ",e),0n}static resolveFlags(e){let t=[];for(let[a,s]of Object.entries(y))e&s&&t.push(a);return t}has(e){let t=this.resolveBitFields(e);return(this.bitfield&t)===t}remove(e){let t=this.resolveBitFields(e);return this.bitfield&=~t,this}add(e){let t=this.resolveBitFields(e);return this.bitfield|=t,this}missing(e){let a=this.resolveBitFields(e)&~this.bitfield;return this.resolveBitFlags(a)}static overwriteFor(e,t,a){let s="permissions"in e,r=this.permissionsFor(e,a);if(!s&&a.owner_id===e.user.id)return this.all();if(r.has("Administrator"))return this.all();let d=t.permission_overwrites.find(i=>i.id===t.guild_id);if(s){let i=new n(e.permissions),f=t.permission_overwrites.find(b=>b.id===e.id);return d&&i.remove(d.deny).add(d.allow),f&&i.remove(f.deny).add(f.allow),i}let l=t.permission_overwrites.map(i=>i.type===E.Role&&e.roles.includes(i.id)&&i).filter(i=>i!==!1),m=t.permission_overwrites.find(i=>i.id===e.user.id);return d&&r.remove(d.deny).add(d.allow),l.length&&(r.remove(this.resolveBits(l.map(i=>i.deny))),r.add(this.resolveBits(l.map(i=>i.allow)))),m&&r.remove(m.deny).add(m.allow),r}static permissionsFor(e,t){let a="position"in e;if(!a&&t.owner_id===e.user.id)return this.all();let s=new n(a?e.permissions:e.roles.map(r=>{let d=t.roles.find(m=>m.id===r);if(!d)throw new Error("Role not found");let l=t.roles.find(m=>m.id===t.id);return BigInt(d.permissions)|BigInt(l.permissions)}));return s.has("Administrator")?this.all():s}static all(){let e=Object.values(y).reduce((t,a)=>t|a,0n);return new n(e)}toArray(){return this.flags}};import{DateTime as T}from"luxon";import{zone as w}from"@skyhelperbot/constants";function oe(){let n=T.fromISO("2025-11-20",{zone:w}).startOf("day"),e=T.now().setZone(w),t=n.plus({days:3}).endOf("day"),a=t;for(;e>a;)a=a.plus({days:14});let s=a.minus({days:3}).startOf("day");if(e<s){let r=s.diffNow(["days","hours","minutes","seconds"]).toFormat("d'd' h'h' m'm' s's'");if(s>n)return{visiting:!1,nextVisit:s,duration:r};if(s.equals(n))return{visiting:!1,nextVisit:s,duration:r}}if(e>=s&&e<=a){let r=a.diffNow(["days","hours","minutes","seconds"]).toFormat("d'd' h'h' m'm' s's'");if(t<a)return{visiting:!0,nextVisit:s,duration:r};if(n.equals(a))return{visiting:!0,nextVisit:s,duration:r}}}function le(n,e=8){let t=Math.round(n/100*e),a="";for(let s=0;s<e;s++){let r=s<t;s===0?a+=r?`<:_:${u.progress_filled_start}>`:`<:_:${u.progress_empty_start}>`:s===e-1?a+=r?`<:_:${u.progress_filled_end}>`:`<:_:${u.progress_empty_end}>`:a+=r?`<:_:${u.progress_filled_middle}>`:`<:_:${u.progress_empty_middle}>`}return`${a} ${n}%`}import{DateTime as g}from"luxon";var _=n=>{let e=(t,a,s,r,d,l,m,i,f,b,S)=>({earlySky:n.startOf("day").plus({hours:t,minutes:a,seconds:s}),gateShard:n.startOf("day").plus({hours:r,minutes:d}),start:n.startOf("day").plus({hours:l,minutes:m,seconds:i}),end:n.startOf("day").plus({hours:f,minutes:b}),shardMusic:S});return{C:[e(7,7,50,7,40,7,48,40,11,40,"Lights Afar"),e(13,7,50,13,40,13,48,40,17,40,"Lights Afar"),e(19,7,50,19,40,19,48,40,23,40,"Lights Afar")],b:[e(1,37,50,2,10,2,18,40,6,10,"An Abrupt Premonition"),e(9,37,50,10,10,10,18,40,14,10,"An Abrupt Premonition"),e(17,37,50,18,10,18,18,40,22,10,"An Abrupt Premonition")],A:[e(1,47,50,2,20,2,28,40,6,20,"Lights Afar"),e(7,47,50,8,20,8,28,40,12,20,"Lights Afar"),e(13,47,50,14,20,14,28,40,18,20,"Lights Afar")],a:[e(1,17,50,1,50,1,58,40,5,50,"An Abrupt Premonition"),e(9,17,50,9,50,9,58,40,13,50,"An Abrupt Premonition"),e(17,17,50,17,50,17,58,40,21,50,"An Abrupt Premonition")],B:[e(2,57,50,3,30,3,38,40,7,30,"Of The Essence"),e(8,57,50,9,30,9,38,40,13,30,"Of The Essence"),e(14,57,50,15,30,15,38,40,19,30,"Of The Essence")]}};var o={a:{type:"black",colors:"#000000",weekdays:[6,7]},A:{type:"red",colors:"#FF0000",weekdays:[2,3]},b:{type:"black",colors:"#000000",weekdays:[7,1]},B:{type:"red",colors:"#FF0000",weekdays:[3,4]},C:{type:"red",colors:"#FF0000",weekdays:[1,2]}},D={prairie:{a:{area:"Butterfly Fields, <:r5Prairie:1150596314883690607> Daylight Prairie",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226741731119165/ButterflyFields.png",...o.a,location:"https://media.discordapp.net/attachments/575827924343848960/1119162577126178846/01_Daylight_Prairie_-_Butterfly_Field.png",data:"https://media.discordapp.net/attachments/575827924343848960/1053249686422687784/dp-b_Butterfly_Field.png"},A:{area:"Bird's Nest, <:r5Prairie:1150596314883690607> Daylight Prairie",ac:2.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226742024708187/BirdsNest.png",...o.A,location:"https://media.discordapp.net/attachments/575827924343848960/1109738791268257812/01_Daylight_Prairie_-_Birds_Nest.png",data:"https://media.discordapp.net/attachments/575827924343848960/1044197796577824839/dp-r_Bird_Nest.png"},b:{area:"Village Island, <:r5Prairie:1150596314883690607> Daylight Prairie",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226741412343989/VillageIsland.png",...o.b,location:"https://media.discordapp.net/attachments/575827924343848960/1115536957875945604/01_Daylight_Prairie_-_Village_Islands_and_Koi_Pond.png",data:"https://media.discordapp.net/attachments/575827924343848960/1049635543421550652/dp-b_Village-Koi.png"},B:{area:"Sanctuary Island, <:r5Prairie:1150596314883690607> Daylight Prairie",ac:3.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226740741263510/SanctuaryIsland.png",...o.B,location:"https://media.discordapp.net/attachments/575827924343848960/1117348946390564934/IMG_4458.png",data:"https://media.discordapp.net/attachments/575827924343848960/1051464559065583637/dp-r_Sanctuary_Islands.png"},C:{area:"Prairie Caves, <:r5Prairie:1150596314883690607> Daylight Prairie",ac:2,image:"https://media.discordapp.net/attachments/867638574571323424/1159226741110349925/PrairieCave.png",...o.C,location:"https://media.discordapp.net/attachments/575827924343848960/1124597919178313749/01_Daylight_Prairie_-_Prairie_Caves.png",data:"https://media.discordapp.net/attachments/1123347180988661902/1126113425286766702/dp-r_Caves.jpg"}},forest:{a:{area:"Forest Brook, <:r4Forest:1150596343354630235> Hidden Forest",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226847062671400/ForestBrook.png",...o.a,location:"https://media.discordapp.net/attachments/575827924343848960/1117712849217781871/IMG_3543.png",data:"https://media.discordapp.net/attachments/575827924343848960/1051802895634399242/hf-b_Forest_Brook.png"},A:{area:"Treehouse, <:r4Forest:1150596343354630235> Hidden Forest",ac:3.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226739713650788/Treehouse.png",...o.A,location:"https://media.discordapp.net/attachments/575827924343848960/1111912764420665394/02_Hidden_Forest_-_Assembly_Treehouse.png",data:"https://media.discordapp.net/attachments/575827924343848960/1046371999586451597/png_20221027_180854_0000.png"},b:{area:"Boneyard, <:r4Forest:1150596343354630235> Hidden Forest",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226740472819793/Boneyard.png",...o.b,location:"https://media.discordapp.net/attachments/575827924343848960/1121336759633059890/02_Hidden_Forest_-_Broken_Bridge.png",data:"https://media.discordapp.net/attachments/575827924343848960/1048189111145603072/hf-b_Boneyard.png"},B:{area:"Sunny Forest, <:r4Forest:1150596343354630235> Hidden Forest",ac:3.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226659518558298/ElevatedClearing.png",...o.B,location:"https://media.discordapp.net/attachments/575827924343848960/1119522919983349780/02_Hidden_Forest_-_Elevated_Clearing.png",data:"https://media.discordapp.net/attachments/575827924343848960/1053645676870897724/hf-r_Elevated_Clearing.png"},C:{area:"Forest End, <:r4Forest:1150596343354630235> Hidden Forest",ac:2.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226740099534868/ForestEnd.png",...o.C,location:"https://media.discordapp.net/attachments/575827924343848960/1115899669847998526/02_Hidden_Forest_-_Forest_End.png",data:"https://media.discordapp.net/attachments/575827924343848960/1050078656015376496/hf-r_Forest_End.png"}},valley:{a:{area:"Ice Rink, <:r3Valley:1150596376930037850> Valley of Triumph",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226659262693446/IceRink.png",...o.a,location:"https://media.discordapp.net/attachments/575827924343848960/1116263531101306940/03_Valley_of_Triumph_-_Ice_Rink.png",data:"https://media.discordapp.net/attachments/575827924343848960/1050351219383730186/vt-b_Ice_Rink.png"},A:{area:"Village of Dreams, <:r3Valley:1150596376930037850> Valley of Triumph",ac:2.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226658918780948/VillageOfDreams.png",...o.A,location:"https://media.discordapp.net/attachments/575827924343848960/1114449712070799360/03_Valley_of_Triumph_-_Village_of_Dreams.png",data:"https://media.discordapp.net/attachments/575827924343848960/1048546903702384721/vt-r_Village_of_Dreams.png"},b:{area:"Ice Rink, <:r3Valley:1150596376930037850> Valley of Triumph",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226659262693446/IceRink.png",...o.b,location:"https://media.discordapp.net/attachments/575827924343848960/1116263531101306940/03_Valley_of_Triumph_-_Ice_Rink.png",data:"https://media.discordapp.net/attachments/575827924343848960/1050351219383730186/vt-b_Ice_Rink.png"},B:{area:"Hermit's Valley, <:r3Valley:1150596376930037850> Valley of Triumph",ac:3.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226658629365770/HermitsValley.png",...o.B,location:"https://media.discordapp.net/attachments/575827924343848960/1110464646911115314/03_Valley_of_Triumph_-_Hermit_Valley.png",data:"https://media.discordapp.net/attachments/575827924343848960/1055814361026936952/vt-r_Hermit_Valley.png"},C:{area:"Village of Dreams, <:r3Valley:1150596376930037850> Valley of Triumph",ac:2.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226658918780948/VillageOfDreams.png",...o.C,location:"https://media.discordapp.net/attachments/575827924343848960/1114449712070799360/03_Valley_of_Triumph_-_Village_of_Dreams.png",data:"https://media.discordapp.net/attachments/575827924343848960/1048546903702384721/vt-r_Village_of_Dreams.png"}},wasteland:{a:{area:"Broken Temple, <:r2Wasteland:1150596423822356511> Golden Wasteland",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226658209923202/BrokenTemple.png",...o.a,location:"https://media.discordapp.net/attachments/575827924343848960/1125685677384806531/04_Golden_Wasteland_-_Broken_Temple.png",data:"https://media.discordapp.net/attachments/575827924343848960/1045297714474254396/gw-b_Broken_Temple.png"},A:{area:"Crab Fields, <:r2Wasteland:1150596423822356511> Golden Wasteland",ac:2.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226846794231919/CrabFields.png",...o.A,location:"https://media.discordapp.net/attachments/575827924343848960/1094518173262417990/04_Golden_Wasteland_-_Crab_Fields.png",data:"https://media.discordapp.net/attachments/575827924343848960/1050722076681568256/gw-r_Shipwreck.png"},b:{area:"Battlefield, <:r2Wasteland:1150596423822356511> Golden Wasteland",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226657148784680/Battlefield.png",...o.b,location:"https://media.discordapp.net/attachments/575827924343848960/1118435910615302164/04_Golden_Wasteland_-_Battlefield.png",data:"https://media.discordapp.net/attachments/575827924343848960/1052530499668688957/gw-b_Battlefield.png"},B:{area:"Forgotten Ark, <:r2Wasteland:1150596423822356511> Golden Wasteland",ac:3.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226657933119508/ForgottenArk.png",...o.B,location:"https://media.discordapp.net/attachments/575827924343848960/1112639178048548884/IMG_3148.png",data:"https://media.discordapp.net/attachments/575827924343848960/1069221627918827622/Forgotten_Ark_1.png"},C:{area:"Graveyard, <:r2Wasteland:1150596423822356511> Golden Wasteland",ac:2,image:"https://media.discordapp.net/attachments/867638574571323424/1159226742263787623/Graveyard.png",...o.C,location:"https://media.discordapp.net/attachments/575827924343848960/1109015846753419294/04_Golden_Wasteland_-_Graveyard.png",data:"https://media.discordapp.net/attachments/575827924343848960/1043553879289253919/gw-r_Graveyard.png"}},vault:{a:{area:"Starlight Desert, <:r1Vault:1150596447679553636> Vault of Knowledge",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226657656287392/StarlightDesert.png",...o.a,location:"https://media.discordapp.net/attachments/575827924343848960/1090896818604347392/IMG_1525.png",data:"https://media.discordapp.net/attachments/575827924343848960/1077178980051984455/vk-b_Starlight_Desert.png"},A:{area:"Jellyfish Cove, Starlight Desert, <:r1Vault:1150596447679553636> Vault of Knowledge",ac:3.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226657404616756/JellyfishCove.png",...o.A,location:"https://media.discordapp.net/attachments/575827924343848960/1089082330305544242/05_Vault_of_Knowledge_-_Jellyfish_Cove.png",data:"https://media.discordapp.net/attachments/575827924343848960/1049290746190106694/vk-r_Starlight_Desert.png"},b:{area:"Starlight Desert, <:r1Vault:1150596447679553636> Vault of Knowledge",wax:200,image:"https://media.discordapp.net/attachments/867638574571323424/1159226657656287392/StarlightDesert.png",...o.b,location:"https://media.discordapp.net/attachments/575827924343848960/1090896818604347392/IMG_1525.png",data:"https://media.discordapp.net/attachments/575827924343848960/1077178980051984455/vk-b_Starlight_Desert.png"},B:{area:"Jellyfish Cove, Starlight Desert, <:r1Vault:1150596447679553636> Vault of Knowledge",ac:3.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226657404616756/JellyfishCove.png",...o.B,location:"https://media.discordapp.net/attachments/575827924343848960/1089082330305544242/05_Vault_of_Knowledge_-_Jellyfish_Cove.png",data:"https://media.discordapp.net/attachments/575827924343848960/1049290746190106694/vk-r_Starlight_Desert.png"},C:{area:"Jellyfish Cove, Starlight Desert, <:r1Vault:1150596447679553636> Vault of Knowledge",ac:3.5,image:"https://media.discordapp.net/attachments/867638574571323424/1159226657404616756/JellyfishCove.png",...o.C,location:"https://media.discordapp.net/attachments/575827924343848960/1089082330305544242/05_Vault_of_Knowledge_-_Jellyfish_Cove.png",data:"https://media.discordapp.net/attachments/575827924343848960/1049290746190106694/vk-r_Starlight_Desert.png"}}};var p=n=>n*60,h={geyser:{name:"Geyser",index:0,duration:15,offset:0,infographic:{by:"Clement",image:"https://media.discordapp.net/attachments/867638574571323424/1252998364941914243/Visit_Geyser_Clement.png?ex=66744129&is=6672efa9&hm=8d76d1767aca362d23547b1e3beb2b610f58e4fbec24b12af56fdc745f7074e8&"},displayAllTimes:!0,interval:p(2)},grandma:{name:"Grandma",index:1,duration:15,offset:30,infographic:{by:"Clement",image:"https://media.discordapp.net/attachments/867638574571323424/1252998366288416849/Visit_Grandma_Clement.png?ex=6674412a&is=6672efaa&hm=7228b695ec7008204fede2f3d6b4864a06a7cfa25a14ab4d7572957ee940044c&"},displayAllTimes:!0,interval:p(2)},turtle:{name:"Turtle",index:2,duration:10,offset:50,infographic:{by:"Velvet",image:"https://media.discordapp.net/attachments/867638574571323424/1252998363205472316/Visit_Turtle_Velvet.jpg?ex=66744129&is=6672efa9&hm=8c189ff8501fc88810606b832addbea8a9a81eb7a7a6b17019ff1ced593e1ae8&"},displayAllTimes:!0,interval:p(2)},"daily-reset":{name:"Daily Reset",index:3,offset:0,interval:p(24)},eden:{name:"Eden/Weekly Reset",index:4,offset:0,interval:p(168),occursOn:{weekDays:[7]}},aurora:{name:"Aurora's concert",index:5,offset:0,duration:50,displayAllTimes:!0,interval:p(2)},"dream-skater":{name:"Dream Skater",index:6,duration:15,displayAllTimes:!0,occursOn:{weekDays:[5,6,7]},offset:p(1),interval:p(2)},"passage-quests":{name:"Passage Quests",index:7,offset:0,displayAllTimes:!0,interval:15},"nest-sunset":{name:"Nest Sunset",index:8,offset:40,displayAllTimes:!0,interval:p(1)},"fireworks-festival":{name:"Fireworks Festival",index:9,offset:0,duration:10,displayAllTimes:!0,interval:p(4),occursOn:{dayOfTheMonth:1}},"fairy-ring":{name:"Fairy Ring",index:11,offset:50,displayAllTimes:!0,interval:60},"brook-rainbow":{name:"Forest Brook Rainbow",index:12,displayAllTimes:!0,offset:p(5),interval:p(12)}};import{CDNRoutes as ke}from"discord-api-types/v10";function I(n,e){let t=[],a=n.startOf("day"),s=e.startOf("day");for(;a<=s;)t.push(a),a=a.plus({days:1});return t}import{zone as G}from"@skyhelperbot/constants";var P=["C","b","A","a","B","b","C","a","A","b","B","a"],C=["prairie","forest","valley","wasteland","vault"],k=class{static getDate(e){let t="America/Los_Angeles",a;try{if(e){let[s,r,d]=e.split("-").map(Number);a=g.fromObject({year:s,month:r,day:d},{zone:t}).startOf("day")}else a=g.now().setZone(t).startOf("day");return a.isValid?a:"invalid"}catch(s){throw new Error(s)}}static shardsIndex(e){let t=e.day,a=(t-1)%P.length,s=P[a],r=(t-1)%C.length,d=C[r];return{currentShard:s,currentRealm:d}}static getSuffix(e){let t=["th","st","nd","rd"],a=e%10,s=e%100;return t[a===1&&s!==11?1:a===2&&s!==12?2:a===3&&s!==13?3:0]}static getStatus(e){let t="America/Los_Angeles",{currentShard:a}=this.shardsIndex(e),s=_(e)[a],r=g.now().setZone(t);if(o[a].weekdays.includes(e.weekday))return"No Shard";let l=[];for(let m=0;m<s.length;m++){let i=s[m];if(r>=i.start&&r<=i.end){l.push({index:m+1,active:!0,start:i.start,end:i.end,duration:i.end.diff(r,["days","hours","minutes","seconds"]).toFormat("dd'd' hh'h' mm'm' ss's'")});continue}else if(r<i.start){l.push({index:m+1,active:!1,start:i.start,end:i.end,duration:i.start.diff(r,["days","hours","minutes","seconds"]).toFormat("dd'd' hh'h' mm'm' ss's'")});continue}else if(r>i.end){l.push({index:m+1,ended:!0,start:i.start,end:i.end,duration:r.diff(i.end,["days","hours","minutes","seconds"]).toFormat("dd'd' hh'h' mm'm' ss's'")});continue}}return l}static getShard(e){let{currentRealm:t,currentShard:a}=this.shardsIndex(e),s=D[t][a];if(o[a].weekdays.includes(e.weekday))return null;let d=_(e)[a];return{info:s,timings:d}}static getNextShard(e,t){let a=this.getShard(e);if(!a||t&&!t.some(s=>a.info.type.toLowerCase().includes(s)))return null;for(let[s,r]of a.timings.entries())if(e<=r.start)return{index:s+1,start:r.start,end:r.end,duration:r.start.diff(e,["days","hours","minutes","seconds"]).toFormat("dd'd' hh'h' mm'm' ss's'"),info:a.info};return null}static getNextShardFromNow(e){let t=g.now().setZone("America/Los_Angeles"),a=this.getNextShard(t,e);for(;!a;)t=t.plus({days:1}).startOf("day"),a=this.getNextShard(t,e);return a}static getShardsBetween(e=g.now().setZone(G),t){let a=I(e,t),s=[];for(let r of a)s.push({date:r,shard:this.getNextShard(r)});return s}};import{DateTime as A}from"luxon";var M=class{static getAllTimes(e,t){let a=e,s=[];for(;e.hasSame(a,"day");)s.push(`<t:${a.toUnixInteger()}:t>`),a=a.plus({minutes:t??0});return s.join(" \u2022 ")}static getOccurrenceDay(e){let t=A.now().setZone("America/Los_Angeles").startOf("day").plus({minutes:e.offset});if(e.occursOn){if(e.occursOn.weekDays)for(;!e.occursOn.weekDays.includes(t.weekday);)t=t.plus({days:1});if(e.occursOn.dayOfTheMonth)for(;t.day!==e.occursOn.dayOfTheMonth;)t=t.plus({days:1})}return t}static getNextEventOccurrence(e){let t=h[e];if(!t)throw new Error("Unknown Event");let a=A.now().setZone("America/Los_Angeles"),s=this.getOccurrenceDay(t);for(;s<a;)s=s.plus({minutes:t.interval??0});return s}static getEventDetails(e){let t=this.getNextEventOccurrence(e);return{event:h[e],nextOccurence:t,allOccurences:this.getAllTimes(this.getOccurrenceDay(h[e]),h[e].interval),status:this.getEventStatus(h[e],t)}}static allEventDetails(){let e=Object.keys(h).sort((a,s)=>h[a].index-h[s].index),t=[];for(let a of e)t.push([a,this.getEventDetails(a)]);return t}static getEventStatus(e,t){let a=A.now().setZone("America/Los_Angeles"),s={active:!1,nextTime:t,duration:t.diff(a).toFormat("d'd' h'h' m'm' s's'")};if(!e.duration)return s;let r=t.minus({minutes:e.interval??0}),d=r.plus({minutes:e.duration});return a>=r&&a<=d?{active:!0,startTime:r,endTime:d,nextTime:t,duration:d.diff(a).toFormat("d'd' h'h' m'm' s's'")}:s}};export{v as PermissionsUtil,k as ShardsUtil,M as SkytimesUtils,te as button,q as container,le as createEmojiProgressBar,h as eventData,X as file,oe as getNextTs,Z as mediaGallery,J as mediaGalleryItem,U as parseDateFormat,$ as parsePerms,O as postToHaste,W as resolveColor,ee as row,Q as section,z as separator,o as shardConfig,D as shardsInfo,_ as shardsTimeline,V as textDisplay,H as thumbnail};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param dir - the directory to read (from the root directory)
|
|
3
|
-
* @param skipDirectories The directories/sub-directories to skip
|
|
4
|
-
* @param allowedExtensions extension of the files to read
|
|
5
|
-
* @example
|
|
6
|
-
* const { reacursiveReadDir } = require('skyhelper-utils');
|
|
7
|
-
*
|
|
8
|
-
* const files = recursiveReadDir('src/commands');
|
|
9
|
-
* const commands = [];
|
|
10
|
-
* files.forEach((file) => {
|
|
11
|
-
* const command = require(file);
|
|
12
|
-
* commands.push(command.data.name, command);
|
|
13
|
-
* });
|
|
14
|
-
*/
|
|
15
|
-
export declare const recursiveReadDir: (dir: string, skipDirectories?: string[], allowedExtensions?: string[]) => string[];
|
|
16
|
-
//# sourceMappingURL=recursiveReadDir.d.ts.map
|