snowtransfer
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -1,8 +0,2 @@ | ||
var x=Object.defineProperty;var We=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var Ve=Object.prototype.hasOwnProperty;var S=(r,e)=>()=>(r&&(e=r(r=0)),e);var _=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),me=(r,e)=>{for(var t in e)x(r,t,{get:e[t],enumerable:!0})},Fe=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ke(e))!Ve.call(r,i)&&i!==t&&x(r,i,{get:()=>e[i],enumerable:!(s=We(e,i))||s.enumerable});return r};var Ee=r=>Fe(x({},"__esModule",{value:!0}),r);var f=_((Wt,he)=>{var Je={REST_API_VERSION:10,GET_CHANNEL_MESSAGES_MIN_RESULTS:1,GET_CHANNEL_MESSAGES_MAX_RESULTS:100,GET_GUILD_SCHEDULED_EVENT_USERS_MIN_RESULTS:1,GET_GUILD_SCHEDULED_EVENT_USERS_MAX_RESULTS:100,SEARCH_MEMBERS_MIN_RESULTS:1,SEARCH_MEMBERS_MAX_RESULTS:1e3,BULK_DELETE_MESSAGES_MIN:2,BULK_DELETE_MESSAGES_MAX:100,OK_STATUS_CODES:[200,201,204,304]};he.exports=Je});var m=_((Kt,ye)=>{"use strict";var ze=f(),n={BASE_URL:"/api/v"+ze.REST_API_VERSION,BASE_HOST:"https://discord.com",CDN_URL:"https://cdn.discordapp.com",APPLICATION_COMMAND:(r,e)=>`${n.APPLICATION_COMMANDS(r)}/${e}`,APPLICATION_COMMANDS:r=>`/applications/${r}/commands`,APPLICATION_GUILD_COMMANDS_PERMISSIONS:(r,e)=>`${n.APPLICATION_GUILD_COMMANDS(r,e)}/permissions`,APPLICATION_GUILD_COMMAND_PERMISSIONS:(r,e,t)=>`${n.APPLICATION_GUILD_COMMAND(r,e,t)}/permissions`,APPLICATION_GUILD_COMMAND:(r,e,t)=>`${n.APPLICATION_GUILD_COMMANDS(r,e)}/${t}`,APPLICATION_GUILD_COMMANDS:(r,e)=>`/applications/${r}/guilds/${e}/commands`,CHANNEL:r=>`${n.CHANNELS}/${r}`,CHANNEL_BULK_DELETE:r=>`${n.CHANNEL_MESSAGES(r)}/bulk-delete`,CHANNEL_FOLLOWERS:r=>`${n.CHANNEL(r)}/followers`,CHANNEL_INVITES:r=>`${n.CHANNEL(r)}/invites`,CHANNEL_MESSAGE:(r,e)=>`${n.CHANNEL_MESSAGES(r)}/${e}`,CHANNEL_MESSAGE_CROSSPOST:(r,e)=>`${n.CHANNEL_MESSAGE(r,e)}/crosspost`,CHANNEL_MESSAGE_REACTION:(r,e,t)=>`${n.CHANNEL_MESSAGE_REACTIONS(r,e)}/${t}`,CHANNEL_MESSAGE_REACTION_USER:(r,e,t,s)=>`${n.CHANNEL_MESSAGE_REACTION(r,e,t)}/${s}`,CHANNEL_MESSAGE_REACTIONS:(r,e)=>`${n.CHANNEL_MESSAGE(r,e)}/reactions`,CHANNEL_MESSAGE_THREADS:(r,e)=>`${n.CHANNEL_MESSAGE(r,e)}/threads`,CHANNEL_MESSAGES:r=>`${n.CHANNEL(r)}/messages`,CHANNEL_PERMISSION:(r,e)=>`${n.CHANNEL_PERMISSIONS(r)}/${e}`,CHANNEL_PERMISSIONS:r=>`${n.CHANNEL(r)}/permissions`,CHANNEL_PIN:(r,e)=>`${n.CHANNEL_PINS(r)}/${e}`,CHANNEL_PINS:r=>`${n.CHANNEL(r)}/pins`,CHANNEL_RECIPIENT:(r,e)=>`${n.CHANNEL(r)}/recipients/${e}`,CHANNEL_THREADS:r=>`${n.CHANNEL(r)}/threads`,CHANNEL_THREAD_MEMBER:(r,e)=>`${n.CHANNEL_THREAD_MEMBERS(r)}/${e}`,CHANNEL_THREAD_MEMBERS:r=>`${n.CHANNEL(r)}/thread-members`,CHANNEL_THREADS_ARCHIVED_PRIVATE:r=>`${n.CHANNEL_THREADS(r)}/archived/private`,CHANNEL_THREADS_ARCHIVED_PRIVATE_USER:r=>`${n.CHANNEL(r)}/users/@me/threads/archived/private`,CHANNEL_THREADS_ARCHIVED_PUBLIC:r=>`${n.CHANNEL_THREADS(r)}/archived/public`,CHANNEL_TYPING:r=>`${n.CHANNEL(r)}/typing`,CHANNEL_WEBHOOKS:r=>`${n.CHANNEL(r)}/webhooks`,CHANNELS:"/channels",GATEWAY:"/gateway",GATEWAY_BOT:"/gateway/bot",GUILD:r=>`${n.GUILDS}/${r}`,GUILD_AUDIT_LOGS:r=>`${n.GUILD(r)}/audit-logs`,GUILD_BAN:(r,e)=>`${n.GUILD_BANS(r)}/${e}`,GUILD_BANS:r=>`${n.GUILD(r)}/bans`,GUILD_CHANNELS:r=>`${n.GUILD(r)}/channels`,GUILD_EMOJI:(r,e)=>`${n.GUILD_EMOJIS(r)}/${e}`,GUILD_EMOJIS:r=>`${n.GUILD(r)}/emojis`,GUILD_INVITES:r=>`${n.GUILD(r)}/invites`,GUILD_INTEGRATION:(r,e)=>`${n.GUILD_INTEGRATIONS(r)}/${e}`,GUILD_INTEGRATIONS:r=>`${n.GUILD(r)}/integrations`,GUILD_MEMBER:(r,e)=>`${n.GUILD_MEMBERS(r)}/${e}`,GUILD_MEMBER_ROLE:(r,e,t)=>`${n.GUILD_MEMBER(r,e)}/roles/${t}`,GUILD_MEMBERS:r=>`${n.GUILD(r)}/members`,GUILD_MEMBERS_SEARCH:r=>`${n.GUILD_MEMBERS(r)}/search`,GUILD_PREVIEW:r=>`${n.GUILD(r)}/preview`,GUILD_PRUNE:r=>`${n.GUILD(r)}/prune`,GUILD_ROLE:(r,e)=>`${n.GUILD_ROLES(r)}/${e}`,GUILD_ROLES:r=>`${n.GUILD(r)}/roles`,GUILD_SCHEDULED_EVENTS:r=>`${n.GUILD(r)}/scheduled-events`,GUILD_SCHEDULED_EVENT:(r,e)=>`${n.GUILD_SCHEDULED_EVENTS(r)}/${e}`,GUILD_SCHEDULED_EVENT_USERS:(r,e)=>`${n.GUILD_SCHEDULED_EVENT(r,e)}/users`,GUILD_STICKER:(r,e)=>`${n.GUILD_STICKERS(r)}/${e}`,GUILD_STICKERS:r=>`${n.GUILD(r)}/stickers`,GUILD_TEMPLATE:(r,e)=>`${n.GUILD_TEMPLATES(r)}/${e}`,GUILD_THREADS_ACTIVE:r=>`${n.GUILD(r)}/threads/active`,GUILD_TEMPLATES:r=>`${n.GUILD(r)}/templates`,GUILD_VANITY:r=>`${n.GUILD(r)}/vanity-url`,GUILD_VOICE_REGIONS:r=>`${n.GUILD(r)}/regions`,GUILD_VOICE_STATE_USER:(r,e)=>`${n.GUILD(r)}/voice-states/${e}`,GUILD_WEBHOOKS:r=>`${n.GUILD(r)}/webhooks`,GUILD_WELCOME_SCREEN:r=>`${n.GUILD(r)}/welcome-screen`,GUILD_WIDGET:r=>`${n.GUILD(r)}/widget.json`,GUILD_WIDGET_SETTINGS:r=>`${n.GUILD(r)}/widget`,GUILDS:"/guilds",INTERACTION_CALLBACK:(r,e)=>`/interactions/${r}/${e}/callback`,INVITES:r=>`/invites/${r}`,OAUTH2_APPLICATION:r=>`/oauth2/applications/${r}`,STAGE_INSTANCE_CHANNEL:r=>`${n.STAGE_INSTANCES}/${r}`,STAGE_INSTANCES:"/stage-instances",STICKER:r=>`/stickers/${r}`,TEMPLATE:r=>`/guilds/templates/${r}`,USER:r=>`${n.USERS}/${r}`,USER_CHANNELS:r=>`${n.USER(r)}/channels`,USER_GUILD:(r,e)=>`${n.USER_GUILDS(r)}/${e}`,USER_GUILDS:r=>`${n.USER(r)}/guilds`,USERS:"/users",VOICE_REGIONS:"/voice/regions",WEBHOOK:r=>`/webhooks/${r}`,WEBHOOK_TOKEN:(r,e)=>`${n.WEBHOOK(r)}/${e}`,WEBHOOK_TOKEN_GITHUB:(r,e)=>`${n.WEBHOOK_TOKEN(r,e)}/github`,WEBHOOK_TOKEN_MESSAGE:(r,e,t)=>`/webhooks/${r}/${e}/messages/${t}`,WEBHOOK_TOKEN_SLACK:(r,e)=>`${n.WEBHOOK_TOKEN(r,e)}/slack`};ye.exports=n});function be(r,e){return Xe.test(e)?`@${e}`:`@\u200B${e}`}var u,A,_e,I,Xe,W=S(()=>{u=m(),A=f(),_e=/@([^<>@ ]*)/gsmu,I=class{constructor(e,t){this.requestHandler=e,this.disableEveryone=t}async getChannel(e){return this.requestHandler.request(u.CHANNEL(e),"get","json")}async updateChannel(e,t){return this.requestHandler.request(u.CHANNEL(e),"patch","json",t)}async deleteChannel(e,t){return this.requestHandler.request(u.CHANNEL(e),"delete","json",t?{reason:t}:void 0)}async getChannelMessages(e,t={limit:50}){if(t.around?(delete t.before,delete t.after):t.before?(delete t.around,delete t.after):t.after&&(delete t.before,delete t.around),t.limit!==void 0&&(t.limit<A.GET_CHANNEL_MESSAGES_MIN_RESULTS||t.limit>A.GET_CHANNEL_MESSAGES_MAX_RESULTS))throw new RangeError(`Amount of messages that may be requested has to be between ${A.GET_CHANNEL_MESSAGES_MIN_RESULTS} and ${A.GET_CHANNEL_MESSAGES_MAX_RESULTS}`);return this.requestHandler.request(u.CHANNEL_MESSAGES(e),"get","json",t)}async getChannelMessage(e,t){return this.requestHandler.request(u.CHANNEL_MESSAGE(e,t),"get","json")}async createMessage(e,t,s={disableEveryone:this.disableEveryone}){if(typeof t!="string"&&!t.content&&!t.embeds&&!t.files)throw new Error("Missing content, embeds, files");return typeof t=="string"&&(t={content:t}),t.content&&(s.disableEveryone!==void 0?s.disableEveryone:this.disableEveryone)&&(t.content=t.content.replace(_e,be)),t.files?this.requestHandler.request(u.CHANNEL_MESSAGES(e),"post","multipart",t):this.requestHandler.request(u.CHANNEL_MESSAGES(e),"post","json",t)}async crosspostMessage(e,t){return this.requestHandler.request(u.CHANNEL_MESSAGE_CROSSPOST(e,t),"post","json")}async createReaction(e,t,s){return this.requestHandler.request(u.CHANNEL_MESSAGE_REACTION_USER(e,t,s,"@me"),"put","json")}async deleteReactionSelf(e,t,s){return this.requestHandler.request(u.CHANNEL_MESSAGE_REACTION_USER(e,t,s,"@me"),"delete","json")}async deleteReaction(e,t,s,i){return i?this.requestHandler.request(u.CHANNEL_MESSAGE_REACTION_USER(e,t,s,i),"delete","json"):this.requestHandler.request(u.CHANNEL_MESSAGE_REACTION(e,t,s),"delete","json")}async getReactions(e,t,s,i){return this.requestHandler.request(`${u.CHANNEL_MESSAGE_REACTION(e,t,s)}${i?Object.keys(i).map((o,a)=>`${a===0?"?":"&"}${o}=${i[o]}`).join(""):""}`,"get","json")}async deleteAllReactions(e,t){return this.requestHandler.request(u.CHANNEL_MESSAGE_REACTIONS(e,t),"delete","json")}async editMessage(e,t,s,i={disableEveryone:this.disableEveryone}){if(typeof s!="string"&&s.content===void 0&&s.embeds===void 0&&s.files===void 0)throw new Error("Missing content, embeds, or files");return typeof s=="string"&&(s={content:s}),s.content&&(i.disableEveryone!==void 0?i.disableEveryone:this.disableEveryone)&&(s.content=s.content.replace(_e,be)),s.files?this.requestHandler.request(u.CHANNEL_MESSAGE(e,t),"patch","multipart",s):this.requestHandler.request(u.CHANNEL_MESSAGE(e,t),"patch","json",s)}async deleteMessage(e,t,s){return this.requestHandler.request(u.CHANNEL_MESSAGE(e,t),"delete","json",s?{reason:s}:void 0)}async bulkDeleteMessages(e,t,s){if(t.length<A.BULK_DELETE_MESSAGES_MIN||t.length>A.BULK_DELETE_MESSAGES_MAX)throw new RangeError(`Amount of messages to be deleted has to be between ${A.BULK_DELETE_MESSAGES_MIN} and ${A.BULK_DELETE_MESSAGES_MAX}`);let i=BigInt(Date.now()-142128e7)*BigInt(2)**BigInt(22),o=t.find(c=>BigInt(c)<i);if(o)throw new Error(`The message ${o} is older than 2 weeks and may not be deleted using the bulk delete endpoint`);let a={messages:t};return s&&Object.assign(a,{reason:s}),this.requestHandler.request(u.CHANNEL_BULK_DELETE(e),"post","json",a)}async editChannelPermission(e,t,s){return this.requestHandler.request(u.CHANNEL_PERMISSION(e,t),"put","json",s)}async getChannelInvites(e){return this.requestHandler.request(u.CHANNEL_INVITES(e),"get","json")}async createChannelInvite(e,t={max_age:86400,max_uses:0,temporary:!1,unique:!1}){return this.requestHandler.request(u.CHANNEL_INVITES(e),"post","json",t)}async deleteChannelPermission(e,t,s){return this.requestHandler.request(u.CHANNEL_PERMISSION(e,t),"delete","json",s?{reason:s}:void 0)}async followNewsChannel(e,t){return this.requestHandler.request(u.CHANNEL_FOLLOWERS(e),"post","json",{webhook_channel_id:t})}async startChannelTyping(e){return this.requestHandler.request(u.CHANNEL_TYPING(e),"post","json")}async getChannelPinnedMessages(e){return this.requestHandler.request(u.CHANNEL_PINS(e),"get","json")}async addChannelPinnedMessage(e,t,s){return this.requestHandler.request(u.CHANNEL_PIN(e,t),"put","json",s?{reason:s}:void 0)}async removeChannelPinnedMessage(e,t,s){return this.requestHandler.request(u.CHANNEL_PIN(e,t),"delete","json",s?{reason:s}:void 0)}async createThreadWithMessage(e,t,s){return this.requestHandler.request(u.CHANNEL_MESSAGE_THREADS(e,t),"post","json",s)}async createThreadWithoutMessage(e,t){return this.requestHandler.request(u.CHANNEL_THREADS(e),"post","json",t)}async joinThread(e){return this.requestHandler.request(u.CHANNEL_THREAD_MEMBER(e,"@me"),"put","json")}async addThreadMember(e,t){return this.requestHandler.request(u.CHANNEL_THREAD_MEMBER(e,t),"put","json")}async leaveThread(e){return this.requestHandler.request(u.CHANNEL_THREAD_MEMBER(e,"@me"),"delete","json")}removeThreadMember(e,t){return this.requestHandler.request(u.CHANNEL_THREAD_MEMBER(e,t),"delete","json")}async getThreadMember(e,t){return this.requestHandler.request(u.CHANNEL_THREAD_MEMBER(e,t),"get","json")}async getThreadMembers(e){return this.requestHandler.request(u.CHANNEL_THREAD_MEMBERS(e),"get","json")}async getChannelArchivedPublicThreads(e,t){return this.requestHandler.request(`${u.CHANNEL_THREADS_ARCHIVED_PUBLIC(e)}${t?Object.keys(t).map((s,i)=>`${i===0?"?":"&"}${s}=${t[s]}`).join(""):""}`,"get","json")}async getChannelArchivedPrivateThreads(e,t){return this.requestHandler.request(`${u.CHANNEL_THREADS_ARCHIVED_PRIVATE(e)}${t?Object.keys(t).map((s,i)=>`${i===0?"?":"&"}${s}=${t[s]}`).join(""):""}`,"get","json")}async getChannelArchivedPrivateThreadsUser(e,t){return this.requestHandler.request(`${u.CHANNEL_THREADS_ARCHIVED_PRIVATE_USER(e)}${t?Object.keys(t).map((s,i)=>`${i===0?"?":"&"}${s}=${t[s]}`).join(""):""}`,"get","json")}},Xe=/^[&!]?\d+$/});var b,T,K=S(()=>{b=m(),T=class{constructor(e){this.requestHandler=e}async getEmojis(e){return this.requestHandler.request(b.GUILD_EMOJIS(e),"get","json")}async getEmoji(e,t){return this.requestHandler.request(b.GUILD_EMOJI(e,t),"get","json")}async createEmoji(e,t){return this.requestHandler.request(b.GUILD_EMOJIS(e),"post","json",t)}async updateEmoji(e,t,s){return this.requestHandler.request(b.GUILD_EMOJI(e,t),"patch","json",s)}async deleteEmoji(e,t,s){return this.requestHandler.request(b.GUILD_EMOJI(e,t),"delete","json",s?{reason:s}:void 0)}async getSticker(e){return this.requestHandler.request(b.STICKER(e),"get","json")}async getGuildStickers(e){return this.requestHandler.request(b.GUILD_STICKERS(e),"get","json")}async getGuildSticker(e,t){return this.requestHandler.request(b.GUILD_STICKER(e,t),"get","json")}createGuildSticker(e,t){return this.requestHandler.request(b.GUILD_STICKERS(e),"post","multipart",t)}updateGuildSticker(e,t,s){return this.requestHandler.request(b.GUILD_STICKER(e,t),"patch","json",s)}deleteGuildSticker(e,t,s){return this.requestHandler.request(b.GUILD_STICKER(e,t),"delete","json",s?{reason:s}:void 0)}}});var l,M,C,V=S(()=>{l=m(),M=f(),C=class{constructor(e){this.requestHandler=e}async createGuild(e){return this.requestHandler.request(l.GUILDS,"post","json",e)}async getGuild(e,t){return this.requestHandler.request(`${l.GUILD(e)}${t!==void 0?`?with_counts=${t}`:""}`,"get","json")}async getGuildPreview(e){return this.requestHandler.request(l.GUILD_PREVIEW(e),"get","json")}async updateGuild(e,t){return this.requestHandler.request(l.GUILD(e),"patch","json",t)}async deleteGuild(e){return this.requestHandler.request(l.GUILD(e),"delete","json")}async getGuildChannels(e){return this.requestHandler.request(l.GUILD_CHANNELS(e),"get","json")}async createGuildChannel(e,t){return this.requestHandler.request(l.GUILD_CHANNELS(e),"post","json",t)}async updateChannelPositions(e,t){return this.requestHandler.request(l.GUILD_CHANNELS(e),"patch","json",t)}async listActiveThreads(e){return this.requestHandler.request(l.GUILD_THREADS_ACTIVE(e),"get","json")}async getGuildMember(e,t){return this.requestHandler.request(l.GUILD_MEMBER(e,t),"get","json")}async getGuildMembers(e,t){return this.requestHandler.request(l.GUILD_MEMBERS(e),"get","json",t)}async searchGuildMembers(e,t){if(t.limit!==void 0&&(t.limit<M.SEARCH_MEMBERS_MIN_RESULTS||t.limit>M.SEARCH_MEMBERS_MAX_RESULTS))throw new RangeError(`Limit for searching guild members has to be between ${M.SEARCH_MEMBERS_MIN_RESULTS} and ${M.SEARCH_MEMBERS_MAX_RESULTS}`);return this.requestHandler.request(l.GUILD_MEMBERS_SEARCH(e),"get","json",t)}async addGuildMember(e,t,s){return this.requestHandler.request(l.GUILD_MEMBER(e,t),"put","json",s)}async updateGuildMember(e,t,s){return this.requestHandler.request(l.GUILD_MEMBER(e,t),"patch","json",s)}async updateSelf(e,t){return this.requestHandler.request(l.GUILD_MEMBER(e,"@me"),"patch","json",t)}async addGuildMemberRole(e,t,s,i){return this.requestHandler.request(l.GUILD_MEMBER_ROLE(e,t,s),"put","json",i)}async removeGuildMemberRole(e,t,s,i){return this.requestHandler.request(l.GUILD_MEMBER_ROLE(e,t,s),"delete","json",i?{reason:i}:void 0)}async removeGuildMember(e,t,s){return this.requestHandler.request(l.GUILD_MEMBER(e,t),"delete","json",s?{reason:s}:void 0)}async getGuildBans(e,t){return this.requestHandler.request(`${l.GUILD_BANS(e)}${t?Object.keys(t).map((s,i)=>`${i===0?"?":"&"}${s}=${t[s]}`):""}`,"get","json")}async getGuildBan(e,t){return this.requestHandler.request(l.GUILD_BAN(e,t),"get","json")}async createGuildBan(e,t,s){return this.requestHandler.request(l.GUILD_BAN(e,t),"put","json",s)}async removeGuildBan(e,t,s){return this.requestHandler.request(l.GUILD_BAN(e,t),"delete","json",s?{reason:s}:void 0)}async getGuildRoles(e){return this.requestHandler.request(l.GUILD_ROLES(e),"get","json")}async createGuildRole(e,t){return this.requestHandler.request(l.GUILD_ROLES(e),"post","json",t)}async updateGuildRolePositions(e,t){return this.requestHandler.request(l.GUILD_ROLES(e),"patch","json",t)}async updateGuildRole(e,t,s){return this.requestHandler.request(l.GUILD_ROLE(e,t),"patch","json",s)}async removeGuildRole(e,t,s){return this.requestHandler.request(l.GUILD_ROLE(e,t),"delete","json",s?{reason:s}:void 0)}async getGuildPruneCount(e,t){return this.requestHandler.request(`${l.GUILD_PRUNE(e)}${t?Object.keys(t).map((s,i)=>`${i===0?"?":"&"}${s}=${t[s]}`).join(""):""}`,"get","json")}async startGuildPrune(e,t){return this.requestHandler.request(l.GUILD_PRUNE(e),"post","json",t)}async getGuildVoiceRegions(e){return this.requestHandler.request(l.GUILD_VOICE_REGIONS(e),"get","json")}async getGuildInvites(e){return this.requestHandler.request(l.GUILD_INVITES(e),"get","json")}async getGuildIntegrations(e){return this.requestHandler.request(l.GUILD_INTEGRATIONS(e),"get","json")}async removeGuildIntegration(e,t,s){return this.requestHandler.request(l.GUILD_INTEGRATION(e,t),"delete","json",s?{reason:s}:void 0)}async getGuildWidgetSettings(e){return this.requestHandler.request(l.GUILD_WIDGET_SETTINGS(e),"get","json")}async updateGuildWidgetSettings(e,t){return this.requestHandler.request(l.GUILD_WIDGET_SETTINGS(e),"patch","json",t)}async getGuildWidget(e){return this.requestHandler.request(l.GUILD_WIDGET(e),"get","json")}async getGuildVanityURL(e){return this.requestHandler.request(l.GUILD_VANITY(e),"get","json")}async getGuildWelcomeScreen(e){return this.requestHandler.request(l.GUILD_WELCOME_SCREEN(e),"get","json")}async editGuildWelcomeScreen(e,t){return this.requestHandler.request(l.GUILD_WELCOME_SCREEN(e),"patch","json",t)}updateCurrentUserVoiceState(e,t){return this.requestHandler.request(l.GUILD_VOICE_STATE_USER(e,"@me"),"patch","json",t)}updateUserVoiceState(e,t,s){return this.requestHandler.request(l.GUILD_VOICE_STATE_USER(e,t),"patch","json",s)}}});var L,D,G,F=S(()=>{L=m(),D=f(),G=class{constructor(e){this.requestHandler=e}async listGuildScheduledEvents(e,t){return this.requestHandler.request(`${L.GUILD_SCHEDULED_EVENTS(e)}${t?"?with_user_count=true":""}`,"get","json")}async createGuildScheduledEvent(e,t){return this.requestHandler.request(L.GUILD_SCHEDULED_EVENTS(e),"post","json",t)}async getGuildScheduledEvent(e,t,s){return this.requestHandler.request(`${L.GUILD_SCHEDULED_EVENT(e,t)}${s?"?with_user_count=true":""}`,"get","json")}async editGuildScheduledEvent(e,t,s){return this.requestHandler.request(L.GUILD_SCHEDULED_EVENT(e,t),"patch","json",s)}async deleteGuildScheduledEvent(e,t){return this.requestHandler.request(L.GUILD_SCHEDULED_EVENT(e,t),"delete","json")}async getGuildScheduledEventUsers(e,t,s){if((s==null?void 0:s.limit)!==void 0&&(s.limit<D.GET_GUILD_SCHEDULED_EVENT_USERS_MIN_RESULTS||s.limit>D.GET_GUILD_SCHEDULED_EVENT_USERS_MAX_RESULTS))throw new RangeError(`The maximum amount of users that may be requested has to be between ${D.GET_GUILD_SCHEDULED_EVENT_USERS_MIN_RESULTS} and ${D.GET_GUILD_SCHEDULED_EVENT_USERS_MAX_RESULTS}`);return this.requestHandler.request(`${L.GUILD_SCHEDULED_EVENT_USERS(e,t)}${s?Object.keys(s).map((i,o)=>`${o===0?"?":"&"}${i}=${s[i]}`).join(""):""}`,"get","json")}}});function Se(r,e){return Qe.test(e)?`@${e}`:`@\u200B${e}`}var h,Ae,R,Qe,J=S(()=>{h=m(),Ae=/@([^<>@ ]*)/gsmu,R=class{constructor(e,t){this.requestHandler=e,this.disableEveryone=t}async createWebhook(e,t){return this.requestHandler.request(h.CHANNEL_WEBHOOKS(e),"post","json",t)}async getChannelWebhooks(e){return this.requestHandler.request(h.CHANNEL_WEBHOOKS(e),"get","json")}async getGuildWebhooks(e){return this.requestHandler.request(h.GUILD_WEBHOOKS(e),"get","json")}async getWebhook(e,t){return t?this.requestHandler.request(h.WEBHOOK_TOKEN(e,t),"get","json"):this.requestHandler.request(h.WEBHOOK(e),"get","json")}async updateWebhook(e,t,s){return t?this.requestHandler.request(h.WEBHOOK_TOKEN(e,t),"patch","json",s):this.requestHandler.request(h.WEBHOOK(e),"patch","json",s)}async deleteWebhook(e,t){return t?this.requestHandler.request(h.WEBHOOK_TOKEN(e,t),"delete","json"):this.requestHandler.request(h.WEBHOOK(e),"delete","json")}async executeWebhook(e,t,s,i={disableEveryone:this.disableEveryone}){if(typeof s!="string"&&!(s!=null&&s.content)&&!(s!=null&&s.embeds)&&!(s!=null&&s.files))throw new Error("Missing content or embeds or files");return typeof s=="string"&&(s={content:s}),s.content&&((i==null?void 0:i.disableEveryone)!==void 0?i.disableEveryone:this.disableEveryone)&&(s.content=s.content.replace(Ae,Se)),i&&(delete i.disableEveryone,Object.keys(i).length===0&&(i=void 0)),this.requestHandler.request(`${h.WEBHOOK_TOKEN(e,t)}${i?Object.keys(i).map((o,a)=>`${a===0?"?":"&"}${o}=${i[o]}`).join(""):""}`,"post",s.files?"multipart":"json",s)}async executeWebhookSlack(e,t,s,i={disableEveryone:this.disableEveryone}){return s.text&&((i==null?void 0:i.disableEveryone)!==void 0?i.disableEveryone:this.disableEveryone)&&(s.text=s.text.replace(Ae,Se)),i&&(delete i.disableEveryone,Object.keys(i).length===0&&(i=void 0)),this.requestHandler.request(`${h.WEBHOOK_TOKEN_SLACK(e,t)}${i?Object.keys(i).map((o,a)=>`${a===0?"?":"&"}${o}=${i[o]}`).join(""):""}`,"post","json",s)}async executeWebhookGitHub(e,t,s,i){return this.requestHandler.request(`${h.WEBHOOK_TOKEN_GITHUB(e,t)}${i?Object.keys(i).map((o,a)=>`${a===0?"?":"&"}${o}=${i[o]}`).join(""):""}`,"post","json",s)}async getWebhookMessage(e,t,s,i){return this.requestHandler.request(`${h.WEBHOOK_TOKEN_MESSAGE(e,t,s)}${i?`?thread_id=${i}`:""}`,"get","json")}async editWebhookMessage(e,t,s,i){let o;return i.thread_id&&(o=i.thread_id),delete i.thread_id,this.requestHandler.request(`${h.WEBHOOK_TOKEN_MESSAGE(e,t,s)}${o?`?thread_id=${o}`:""}`,"patch",i.files?"multipart":"json",i)}async deleteWebhookMessage(e,t,s,i){return this.requestHandler.request(`${h.WEBHOOK_TOKEN_MESSAGE(e,t,s)}${i?`?thread_id=${i}`:""}`,"delete","json")}},Qe=/^[&!]?\d+$/});var X=_((Qt,fe)=>{var Ye=m(),z=class{constructor(e){this.requestHandler=e}async getAuditLog(e,t){return this.requestHandler.request(Ye.GUILD_AUDIT_LOGS(e),"get","json",t)}};fe.exports=z});var Y=_((Yt,Le)=>{var He=m(),Q=class{constructor(e){this.requestHandler=e}getGateway(){return this.requestHandler.request(He.GATEWAY,"get","json")}getGatewayBot(){return this.requestHandler.request(He.GATEWAY_BOT,"get","json")}};Le.exports=Q});var ee=_((Zt,Ne)=>{var H=m(),Z=class{constructor(e){this.requestHandler=e}getGuildTemplate(e){return this.requestHandler.request(H.TEMPLATE(e),"get","json")}createGuildFromGuildTemplate(e,t){return this.requestHandler.request(H.TEMPLATE(e),"post","json",t)}getGuildTemplates(e){return this.requestHandler.request(H.GUILD_TEMPLATES(e),"get","json")}createGuildTemplate(e,t){return this.requestHandler.request(H.GUILD_TEMPLATES(e),"post","json",t)}syncGuildTemplate(e,t){return this.requestHandler.request(H.GUILD_TEMPLATE(e,t),"put","json")}modifyGuildTemplate(e,t,s){return this.requestHandler.request(H.GUILD_TEMPLATE(e,t),"patch","json",s)}deleteGuildTemplate(e,t){return this.requestHandler.request(H.GUILD_TEMPLATE(e,t),"delete","json")}};Ne.exports=Z});var se=_((es,Ie)=>{var E=m(),te=class{constructor(e,t){this.requestHandler=e,this.webhooks=t}getApplicationCommands(e,t){return this.requestHandler.request(`${E.APPLICATION_COMMANDS(e)}${t?"?with_localizations=true":""}`,"get","json")}createApplicationCommand(e,t){return this.requestHandler.request(E.APPLICATION_COMMANDS(e),"post","json",t)}getApplicationCommand(e,t){return this.requestHandler.request(E.APPLICATION_COMMAND(e,t),"get","json")}editApplicationCommand(e,t,s){return this.requestHandler.request(E.APPLICATION_COMMAND(e,t),"patch","json",s)}deleteApplicationCommand(e,t){return this.requestHandler.request(E.APPLICATION_COMMAND(e,t),"delete","json")}bulkOverwriteApplicationCommands(e,t){return this.requestHandler.request(E.APPLICATION_COMMANDS(e),"put","json",t)}getGuildApplicationCommands(e,t,s){return this.requestHandler.request(`${E.APPLICATION_GUILD_COMMANDS(e,t)}${s?"?with_localizations=true":""}`,"get","json")}createGuildApplicationCommand(e,t,s){return this.requestHandler.request(E.APPLICATION_GUILD_COMMANDS(e,t),"post","json",s)}getGuildApplicationCommand(e,t,s){return this.requestHandler.request(E.APPLICATION_GUILD_COMMAND(e,t,s),"get","json")}editGuildApplicationCommand(e,t,s,i){return this.requestHandler.request(E.APPLICATION_GUILD_COMMAND(e,t,s),"patch","json",i)}deleteGuildApplicationCommand(e,t,s){return this.requestHandler.request(E.APPLICATION_GUILD_COMMAND(e,t,s),"delete","json")}bulkOverwriteGuildApplicationCommands(e,t,s){return this.requestHandler.request(E.APPLICATION_GUILD_COMMANDS(e,t),"put","json",s)}getGuildApplicationCommandPermissions(e,t,s){return s?this.requestHandler.request(E.APPLICATION_GUILD_COMMAND_PERMISSIONS(e,t,s),"get","json"):this.requestHandler.request(E.APPLICATION_GUILD_COMMANDS_PERMISSIONS(e,t),"get","json")}editGuildApplicationCommandPermissions(e,t,s,i){let o={permissions:i};return this.requestHandler.request(E.APPLICATION_GUILD_COMMAND_PERMISSIONS(e,t,s),"put","json",o)}createInteractionResponse(e,t,s){return this.requestHandler.request(E.INTERACTION_CALLBACK(e,t),"post",s.files?"multipart":"json",s)}getOriginalInteractionResponse(e,t){return this.webhooks.getWebhookMessage(e,t,"@original")}editOriginalInteractionResponse(e,t,s){return this.webhooks.editWebhookMessage(e,t,"@original",s)}deleteOriginalInteractionResponse(e,t){return this.webhooks.deleteWebhookMessage(e,t,"@original")}createFollowupMessage(e,t,s){return this.webhooks.executeWebhook(e,t,s)}getFollowupMessage(e,t,s){return this.webhooks.getWebhookMessage(e,t,s)}editFollowupMessage(e,t,s,i){return this.webhooks.editWebhookMessage(e,t,s,i)}deleteFollowupMessage(e,t,s){return this.webhooks.deleteWebhookMessage(e,t,s)}};Ie.exports=te});var ie=_((ts,Ce)=>{var Te=m(),re=class{constructor(e){this.requestHandler=e}async getInvite(e,t){return this.requestHandler.request(`${Te.INVITES(e)}${t?Object.keys(t).map((s,i)=>`${i===0?"?":"&"}${s}=${t[s]}`).join(""):""}`,"get","json")}async deleteInvite(e){return this.requestHandler.request(Te.INVITES(e),"delete","json")}};Ce.exports=re});var oe=_((ss,Ge)=>{var P=m(),ne=class{constructor(e){this.requestHandler=e}async createStageInstance(e){return this.requestHandler.request(P.STAGE_INSTANCES,"post","json",e)}async getStageInstance(e){return this.requestHandler.request(P.STAGE_INSTANCE_CHANNEL(e),"get","json")}async editStageInstance(e,t){return this.requestHandler.request(P.STAGE_INSTANCE_CHANNEL(e),"patch","json",t)}async deleteStageInstance(e,t){return this.requestHandler.request(P.STAGE_INSTANCE_CHANNEL(e),"delete","json",t?{reason:t}:void 0)}};Ge.exports=ne});var le=_((rs,Re)=>{var N=m(),ae=class{constructor(e){this.requestHandler=e}async getSelf(){return this.requestHandler.request(N.USER("@me"),"get","json")}async getUser(e){return this.requestHandler.request(N.USER(e),"get","json")}async updateSelf(e){return this.requestHandler.request(N.USER("@me"),"patch","json",e)}async getGuilds(e){return this.requestHandler.request(`${N.USER_GUILDS("@me")}${e?Object.keys(e).map((t,s)=>`${s===0?"?":"&"}${t}=${e[t]}`).join(""):""}`,"get","json")}async leaveGuild(e){return this.requestHandler.request(N.USER_GUILD("@me",e),"delete","json")}async createDirectMessageChannel(e){return this.requestHandler.request(N.USER_CHANNELS("@me"),"post","json",{recipient_id:e})}};Re.exports=ae});var de=_((is,qe)=>{var Ze=m(),ue=class{constructor(e){this.requestHandler=e}async getVoiceRegions(){return this.requestHandler.request(Ze.VOICE_REGIONS,"get","json")}};qe.exports=ue});var ve={};me(ve,{BufferAccumulator:()=>U,ConnectionResponse:()=>v,connect:()=>it,socketToRequest:()=>nt});async function De(r,e,t){let s,i=new Promise((a,c)=>{s=setTimeout(()=>{let p=new Error("Timeout reached");c(p),e(p)},t)}),o=await Promise.race([r,i]);return s&&clearTimeout(s),o}function st(r){if(r[0]==="["){let t=r.indexOf("]");return r.substr(1,t-1)}let e=r.indexOf(":");return e===-1?r:r.substr(0,e)}function rt(r){if(!r)return null;let e=st(r);return Me.isIP(e)?"":e}async function it(r,e){let t=new URL(r),s={method:"get",headers:{Host:t.host},bodyInit:Buffer.allocUnsafe(0)};e&&(e.bodyInit||delete e.bodyInit,e.headers&&Object.assign(s.headers,e.headers),delete e.headers,Object.assign(s,e));let i=t.port.length?Number(t.port):t.protocol==="https:"||t.protocol==="wss:"?443:80,o=rt(t.host)||void 0,a,c={host:t.host,port:i,rejectUnauthorized:!1,ALPNProtocols:["http/1.1","http/1.0"],servername:o},p,g,d=new Promise((q,xe)=>{p=q,g=xe}).catch(()=>{});i===443?a=et.connect(c,p):a=Me.connect(c,p),a.setNoDelay(!0),await De(d,g,Pe),e!=null&&e.bodyInit&&(s.headers["Content-Length"]=e.bodyInit.byteLength);let y=`${s.method.toUpperCase()} ${t.pathname}${t.search} HTTP/1.1 | ||
${Object.entries(s.headers).map(q=>`${q[0]}: ${q[1]}`).join(`\r | ||
`)}\r | ||
\r | ||
`,B;return e!=null&&e.bodyInit?B=Buffer.concat([Buffer.from(y),e.bodyInit]):B=Buffer.from(y),a.writable&&a.write(B),a}async function nt(r){let e=(0,$.pipeline)(r,new v,tt),t,s,i=new Promise((o,a)=>{t=a,s=()=>o(e),e.once("done",s)}).catch(()=>{});try{await De(i,t,Pe)}catch(o){throw r.end(),r.destroy(),r.removeListener("end",s),o}return e}var $,Me,et,tt,Pe,ot,at,lt,v,U,Ue=S(()=>{$=require("stream"),Me=require("net"),et=require("tls"),tt=()=>{};Pe=1e4;ot=/(HTTP\/[\d.]+) (\d+) ?(.+)?/,at=/([^:]+): *([^\r\n]+)/,lt=/\r\n/,v=class extends $.Transform{constructor(){super();this.headersReceived=!1;this.body=null;this._bodyPromise=new Promise(t=>this._bodyRes=t);this._bodyAccumulator=null;this._finished=!1;this.once("done",()=>{this._bodyRes(this.body),this._finished=!0})}async json(){if(this._finished)return this.body?JSON.parse(String(this.body)):{};let t=await this._bodyPromise;return t?JSON.parse(String(t)):{}}_transform(t,s,i){let o=null,a=!1,c=null;if(this.headersReceived&&this.headers["transfer-encoding"]==="chunked"){let p=this._parseChunk(t);typeof p=="boolean"?c=p:o=p}else t.subarray(0,5).toString("latin1")==="HTTP/"&&(o=this._parseHead(t),this.emit("headers",this.headers),this.headersReceived=!0,a=!0,this.headers["transfer-encoding"]==="chunked"&&(this._bodyAccumulator=new U(this.headers["content-length"]?Number(this.headers["content-length"]):void 0)));o?(this.push(o),this._bodyAccumulator?this._bodyAccumulator.add(o):(this.body=o,this.emit("done"))):(!a||a&&this.headers["transfer-encoding"]!=="chunked")&&(c===null||c===!0)&&(this._bodyAccumulator&&(this.body=this._bodyAccumulator.concat()),this.emit("done")),i()}_parseHead(t){let s=t.toString("latin1").split(` | ||
`),i=(s[0]||"").match(ot),o={};if(i){let a=1;for(let g of s.slice(1)){let d=g.match(at);if(!d)break;a++,o[d[1].toLowerCase()]=d[2]}let c=s.slice(a+2);if(this.protocol=i[1],this.status=Number(i[2]),this.message=i[3]||"",this.headers=o,!c.length)return null;let p=Buffer.from(c.join(` | ||
`));return p.length?p:null}else return this.protocol="UNKNOWN",this.status=0,this.message="",this.headers=o,null}_parseChunk(t){let i=t.toString().split(lt).filter(c=>c.length),[o,a]=i.slice(-2);return o==="0"?!0:a?Buffer.from(a):!1}},U=class{constructor(e){this.first=null;this.last=null;this.size=0;this._allocated=null;this._streamed=null;e&&(this._allocated=Buffer.allocUnsafe(e),this._streamed=0),this.expecting=e!=null?e:null}add(e){if(this._allocated&&this._streamed!==null&&this.expecting!==null){if(this._streamed===this.expecting)return;this._streamed+e.byteLength>this.expecting?e.subarray(0,this.expecting-this._streamed).copy(this._allocated,this._streamed):e.copy(this._allocated,this._streamed);return}this.first||(this.first={chunk:e,next:null}),this.last&&(this.last.next={chunk:e,next:null}),this.last={chunk:e,next:null},this.size+=e.byteLength}concat(){if(this._allocated)return this._allocated;if(!this.first)return null;if(!this.first.next)return this.first.chunk;let e=Buffer.allocUnsafe(this.size),t=0,s=this.first;for(;s;)s.chunk.copy(e,t),t+=s.chunk.byteLength,s=s.next;return e}}});var $e=_((ns,ut)=>{ut.exports={name:"snowtransfer",version:"0.6.0",description:"Minimalistic Rest client for the Discord Api",main:"./dist/index.js",types:"./dist/index.d.ts",engines:{node:">=12.0.0"},keywords:["discord","api","rest","http","microservice","discord bot","discord bot microservice","microservice bot"],scripts:{"build:src":"tsup src/index.ts --dts --sourcemap --format cjs --target node12 --minify","build:docs":"typedoc --name SnowTransfer --excludeExternals --sort static-first --sort alphabetical"},repository:{type:"git",url:"git+https://github.com/DasWolke/SnowTransfer.git"},bugs:"https://github.com/DasWolke/SnowTransfer/issues",author:"wolke <wolke@weeb.sh>",license:"MIT",dependencies:{"discord-typings":"^10.4.1","form-data":"^4.0.0"},devDependencies:{"@types/node":"^18.11.9","@typescript-eslint/eslint-plugin":"^5.43.0","@typescript-eslint/parser":"^5.43.0",eslint:"^8.28.0",tsup:"^6.5.0",typedoc:"^0.23.21","typedoc-plugin-mdn-links":"^2.0.0","typedoc-plugin-missing-exports":"^1.0.0",typescript:"^4.9.3"},files:["dist","README.md","LICENSE.md"]}});var Oe,dt,pt,pe,O,ct,gt,mt,Et,ht,yt,_t,bt,At,St,ft,j,k,ce,w,je=S(()=>{Oe=require("events"),dt=require("crypto"),pt=require("form-data"),pe=m(),O=(Ue(),Ee(ve)),{version:ct}=$e(),gt=f(),mt=/\/bans/,Et=/\/prune/,ht=/application\/json/,yt=/\/([a-z-]+)\/(?:\d{17,19})/g,_t=/\/reactions\/[^/]+/g,bt=/\/reactions\/:id\/[^/]+/g,At=/^\/webhooks\/(\d+)\/[A-Za-z0-9-_]{64,}/,St=/\/messages\/:id$/,ft=/\/guilds\/\d+\/channels$/,j=class extends Error{constructor(t,s,i,o){var a;super();this.name="DiscordAPIError",this.message=s.message||String(s),this.method=i,this.path=t,this.code=(a=s.code)!=null?a:4e3,this.httpStatus=o}},k=class{constructor(){this.buckets={};this._global=!1;this.globalReset=0;this.globalResetTimeout=null}get global(){return this._global}set global(e){if(e&&this.globalReset!==0){this.globalResetTimeout&&clearTimeout(this.globalResetTimeout);let t=this;this.globalResetTimeout=setTimeout(()=>{t.global=!1},this.globalReset).unref()}else{this.globalResetTimeout&&clearTimeout(this.globalResetTimeout),this.globalResetTimeout=null,this.globalReset=0;for(let t of Object.values(this.buckets))t.checkQueue()}this._global=e}routify(e,t){let s=e.replace(yt,function(i,o){return o==="channels"||o==="guilds"||o==="webhooks"?i:`/${o}/:id`}).replace(_t,"/reactions/:id").replace(bt,"/reactions/:id/:userID").replace(At,"/webhooks/$1/:token");if(t.toUpperCase()==="DELETE"&&St.test(s)?s=t+s:t.toUpperCase()==="GET"&&ft.test(s)&&(s="/guilds/:id/channels"),t==="PUT"||t==="DELETE"){let i=s.indexOf("/reactions");i!==-1&&(s="MODIFY"+s.slice(0,i+10))}return s}queue(e,t,s){let i=this.routify(t,s);this.buckets[i]||(this.buckets[i]=new ce(this,i)),this.buckets[i].queue(e)}},ce=class{constructor(e,t){this.fnQueue=[];this.limit=5;this.remaining=1;this.reset=5e3;this.resetTimeout=null;this.ratelimiter=e,this.routeKey=t}queue(e){return new Promise(t=>{let s=()=>(this.remaining--,this.resetTimeout||(this.resetTimeout=setTimeout(()=>this.resetRemaining(),this.reset)),this.remaining!==0&&this.checkQueue(),t(e(this)));this.fnQueue.push({fn:e,callback:s}),this.checkQueue()})}checkQueue(){this.ratelimiter.global||this.fnQueue.length&&this.remaining!==0&&this.fnQueue.splice(0,1)[0].callback()}resetRemaining(){this.remaining=this.limit,this.resetTimeout&&(clearTimeout(this.resetTimeout),this.resetTimeout=null),this.fnQueue.length?this.checkQueue():delete this.ratelimiter.buckets[this.routeKey]}dropQueue(){this.fnQueue.length=0}},w=class extends Oe.EventEmitter{constructor(t,s){super();this.ratelimiter=t,this.options={baseHost:pe.BASE_HOST,baseURL:pe.BASE_URL,headers:{"User-Agent":`Discordbot (https://github.com/DasWolke/SnowTransfer, ${ct}) Node.js/${process.version}`}},s.token&&(this.options.headers.Authorization=s.token),this.options.baseHost=s.baseHost,this.apiURL=this.options.baseHost+pe.BASE_URL,this.latency=500}request(t,s,i="json",o){return typeof o=="number"&&(o=String(o)),new Promise(async(a,c)=>{this.ratelimiter.queue(async p=>{let g=dt.randomBytes(20).toString("hex");try{this.emit("request",g,{endpoint:t,method:s,dataType:i,data:o!=null?o:{}});let d;if(i=="json")d=await this._request(t,s,o,s==="get"||mt.test(t)||Et.test(t));else if(i=="multipart")d=await this._multiPartRequest(t,s,o);else throw new Error("Forbidden dataType. Use json or multipart");if(d.status&&!gt.OK_STATUS_CODES.includes(d.status)&&d.status!==429)throw new j(t,d.headers["content-type"]&&ht.test(d.headers["content-type"])?{message:JSON.stringify(await d.json())}:{message:String(d.body)},s,d.status);if(this._applyRatelimitHeaders(p,d.headers),d.status===429){if(!this.ratelimiter.global){let y=JSON.parse(String(d.body));y.reset_after!==void 0?this.ratelimiter.globalReset=y.reset_after*1e3:this.ratelimiter.globalReset=1e3,y.global!==void 0&&(this.ratelimiter.global=y.global)}throw this.emit("rateLimit",{timeout:p.reset,limit:p.limit,method:s,path:t,route:this.ratelimiter.routify(t,s)}),new j(t,{message:"You're being ratelimited",code:429},s,d.status)}if(this.emit("done",g,d),d.body){let y;try{y=JSON.parse(d.body.toString())}catch{a(void 0)}return a(y)}else return a(void 0)}catch(d){return this.emit("requestError",g,d),c(d)}},t,s)})}_applyRatelimitHeaders(t,s){s["x-ratelimit-remaining"]&&(t.remaining=parseInt(s["x-ratelimit-remaining"])),s["x-ratelimit-limit"]&&(t.limit=parseInt(s["x-ratelimit-limit"])),s["x-ratelimit-reset"]&&(t.reset=parseInt(s["x-ratelimit-reset"])-Date.now())}async _request(t,s,i,o=!1){let a={...this.options.headers};typeof i!="string"&&(i==null?void 0:i.reason)&&(a["X-Audit-Log-Reason"]=encodeURIComponent(i.reason),delete i.reason);let c=`${this.apiURL}/${t}`,p;o&&i&&Object.keys(i).length?c+=`?${Object.keys(i).map(y=>`${y}=${i[y]}`).join("&")}`:i&&typeof i=="object"?(p=JSON.stringify(i),a["Content-Type"]="application/json"):i&&(p=String(i));let g=await O.connect(c,{method:s,headers:a,bodyInit:p?Buffer.from(p):void 0}),d=await O.socketToRequest(g);return g.end(),d}async _multiPartRequest(t,s,i){let o=new pt;if(i.files&&Array.isArray(i.files)&&i.files.every(g=>!!g.name&&!!g.file)){let g=0;for(let d of i.files)o.append(`files[${g}]`,d.file,{filename:d.name}),delete d.file,g++}i.data&&delete i.files,o.append("payload_json",JSON.stringify(i));let a={...this.options.headers,...o.getHeaders()},c=await O.connect(`${this.apiURL}/${t}`,{method:s,headers:a,bodyInit:o.getBuffer()}),p=await O.socketToRequest(c);return c.end(),p}}});var Be=_((gs,we)=>{je();W();K();J();V();F();var Ht=le(),Lt=ee(),Nt=se(),It=ie(),Tt=de(),Ct=Y(),Gt=X(),Rt=oe(),ke=m(),ge=class{constructor(e,t){if(typeof e=="string"&&e==="")throw new Error("Missing token");e&&!e.startsWith("Bot")&&!e.startsWith("Bearer")&&(e=`Bot ${e}`),this.options={baseHost:ke.BASE_HOST,disableEveryone:!1},this.token=e,Object.assign(this.options,t),this.ratelimiter=new k,this.requestHandler=new w(this.ratelimiter,{token:this.token,baseHost:this.options.baseHost||ke.BASE_HOST}),this.channel=new I(this.requestHandler,this.options.disableEveryone),this.user=new Ht(this.requestHandler),this.guildAssets=new T(this.requestHandler),this.webhook=new R(this.requestHandler,this.options.disableEveryone),this.guild=new C(this.requestHandler),this.guildScheduledEvent=new G(this.requestHandler),this.guildTemplate=new Lt(this.requestHandler),this.interaction=new Nt(this.requestHandler,this.webhook),this.invite=new It(this.requestHandler),this.voice=new Tt(this.requestHandler),this.bot=new Ct(this.requestHandler),this.auditLog=new Gt(this.requestHandler),this.stageInstance=new Rt(this.requestHandler)}};we.exports=ge});var Bt={};me(Bt,{AuditLogMethods:()=>qt,BotMethods:()=>Mt,ChannelMethods:()=>I,Constants:()=>jt,Endpoints:()=>kt,GuildAssetsMethods:()=>T,GuildMethods:()=>C,GuildScheduledEventMethods:()=>G,GuildTemplateMethods:()=>Dt,InteractionMethods:()=>Pt,InviteMethods:()=>vt,SnowTransfer:()=>wt,StageInstanceMethods:()=>Ut,UserMethods:()=>$t,VoiceMethods:()=>Ot,WebhookMethods:()=>R});module.exports=Ee(Bt);W();K();V();F();J();var qt=X(),Mt=Y(),Dt=ee(),Pt=se(),vt=ie(),Ut=oe(),$t=le(),Ot=de(),jt=f(),kt=m(),wt=Be();0&&(module.exports={AuditLogMethods,BotMethods,ChannelMethods,Constants,Endpoints,GuildAssetsMethods,GuildMethods,GuildScheduledEventMethods,GuildTemplateMethods,InteractionMethods,InviteMethods,SnowTransfer,StageInstanceMethods,UserMethods,VoiceMethods,WebhookMethods}); | ||
var $=Object.defineProperty;var Me=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var De=Object.prototype.hasOwnProperty;var H=(s,e)=>()=>(s&&(e=s(s=0)),e);var E=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),Pe=(s,e)=>{for(var t in e)$(s,t,{get:e[t],enumerable:!0})},Ue=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of fe(e))!De.call(s,i)&&i!==t&&$(s,i,{get:()=>e[i],enumerable:!(r=Me(e,i))||r.enumerable});return s};var ve=s=>Ue($({},"__esModule",{value:!0}),s);var A=E((Nt,de)=>{var $e={REST_API_VERSION:10,GET_CHANNEL_MESSAGES_MIN_RESULTS:1,GET_CHANNEL_MESSAGES_MAX_RESULTS:100,GET_GUILD_SCHEDULED_EVENT_USERS_MIN_RESULTS:1,GET_GUILD_SCHEDULED_EVENT_USERS_MAX_RESULTS:100,SEARCH_MEMBERS_MIN_RESULTS:1,SEARCH_MEMBERS_MAX_RESULTS:1e3,BULK_DELETE_MESSAGES_MIN:2,BULK_DELETE_MESSAGES_MAX:100,OK_STATUS_CODES:[200,201,204,304]};de.exports=$e});var p=E((It,ue)=>{"use strict";var Oe=A(),n={BASE_URL:"/api/v"+Oe.REST_API_VERSION,BASE_HOST:"https://discord.com",CDN_URL:"https://cdn.discordapp.com",APPLICATION_COMMAND:(s,e)=>`${n.APPLICATION_COMMANDS(s)}/${e}`,APPLICATION_COMMANDS:s=>`/applications/${s}/commands`,APPLICATION_GUILD_COMMANDS_PERMISSIONS:(s,e)=>`${n.APPLICATION_GUILD_COMMANDS(s,e)}/permissions`,APPLICATION_GUILD_COMMAND_PERMISSIONS:(s,e,t)=>`${n.APPLICATION_GUILD_COMMAND(s,e,t)}/permissions`,APPLICATION_GUILD_COMMAND:(s,e,t)=>`${n.APPLICATION_GUILD_COMMANDS(s,e)}/${t}`,APPLICATION_GUILD_COMMANDS:(s,e)=>`/applications/${s}/guilds/${e}/commands`,CHANNEL:s=>`${n.CHANNELS}/${s}`,CHANNEL_BULK_DELETE:s=>`${n.CHANNEL_MESSAGES(s)}/bulk-delete`,CHANNEL_FOLLOWERS:s=>`${n.CHANNEL(s)}/followers`,CHANNEL_INVITES:s=>`${n.CHANNEL(s)}/invites`,CHANNEL_MESSAGE:(s,e)=>`${n.CHANNEL_MESSAGES(s)}/${e}`,CHANNEL_MESSAGE_CROSSPOST:(s,e)=>`${n.CHANNEL_MESSAGE(s,e)}/crosspost`,CHANNEL_MESSAGE_REACTION:(s,e,t)=>`${n.CHANNEL_MESSAGE_REACTIONS(s,e)}/${t}`,CHANNEL_MESSAGE_REACTION_USER:(s,e,t,r)=>`${n.CHANNEL_MESSAGE_REACTION(s,e,t)}/${r}`,CHANNEL_MESSAGE_REACTIONS:(s,e)=>`${n.CHANNEL_MESSAGE(s,e)}/reactions`,CHANNEL_MESSAGE_THREADS:(s,e)=>`${n.CHANNEL_MESSAGE(s,e)}/threads`,CHANNEL_MESSAGES:s=>`${n.CHANNEL(s)}/messages`,CHANNEL_PERMISSION:(s,e)=>`${n.CHANNEL_PERMISSIONS(s)}/${e}`,CHANNEL_PERMISSIONS:s=>`${n.CHANNEL(s)}/permissions`,CHANNEL_PIN:(s,e)=>`${n.CHANNEL_PINS(s)}/${e}`,CHANNEL_PINS:s=>`${n.CHANNEL(s)}/pins`,CHANNEL_RECIPIENT:(s,e)=>`${n.CHANNEL(s)}/recipients/${e}`,CHANNEL_THREADS:s=>`${n.CHANNEL(s)}/threads`,CHANNEL_THREAD_MEMBER:(s,e)=>`${n.CHANNEL_THREAD_MEMBERS(s)}/${e}`,CHANNEL_THREAD_MEMBERS:s=>`${n.CHANNEL(s)}/thread-members`,CHANNEL_THREADS_ARCHIVED_PRIVATE:s=>`${n.CHANNEL_THREADS(s)}/archived/private`,CHANNEL_THREADS_ARCHIVED_PRIVATE_USER:s=>`${n.CHANNEL(s)}/users/@me/threads/archived/private`,CHANNEL_THREADS_ARCHIVED_PUBLIC:s=>`${n.CHANNEL_THREADS(s)}/archived/public`,CHANNEL_TYPING:s=>`${n.CHANNEL(s)}/typing`,CHANNEL_WEBHOOKS:s=>`${n.CHANNEL(s)}/webhooks`,CHANNELS:"/channels",GATEWAY:"/gateway",GATEWAY_BOT:"/gateway/bot",GUILD:s=>`${n.GUILDS}/${s}`,GUILD_AUDIT_LOGS:s=>`${n.GUILD(s)}/audit-logs`,GUILD_BAN:(s,e)=>`${n.GUILD_BANS(s)}/${e}`,GUILD_BANS:s=>`${n.GUILD(s)}/bans`,GUILD_CHANNELS:s=>`${n.GUILD(s)}/channels`,GUILD_EMOJI:(s,e)=>`${n.GUILD_EMOJIS(s)}/${e}`,GUILD_EMOJIS:s=>`${n.GUILD(s)}/emojis`,GUILD_INVITES:s=>`${n.GUILD(s)}/invites`,GUILD_INTEGRATION:(s,e)=>`${n.GUILD_INTEGRATIONS(s)}/${e}`,GUILD_INTEGRATIONS:s=>`${n.GUILD(s)}/integrations`,GUILD_MEMBER:(s,e)=>`${n.GUILD_MEMBERS(s)}/${e}`,GUILD_MEMBER_ROLE:(s,e,t)=>`${n.GUILD_MEMBER(s,e)}/roles/${t}`,GUILD_MEMBERS:s=>`${n.GUILD(s)}/members`,GUILD_MEMBERS_SEARCH:s=>`${n.GUILD_MEMBERS(s)}/search`,GUILD_PREVIEW:s=>`${n.GUILD(s)}/preview`,GUILD_PRUNE:s=>`${n.GUILD(s)}/prune`,GUILD_ROLE:(s,e)=>`${n.GUILD_ROLES(s)}/${e}`,GUILD_ROLES:s=>`${n.GUILD(s)}/roles`,GUILD_SCHEDULED_EVENTS:s=>`${n.GUILD(s)}/scheduled-events`,GUILD_SCHEDULED_EVENT:(s,e)=>`${n.GUILD_SCHEDULED_EVENTS(s)}/${e}`,GUILD_SCHEDULED_EVENT_USERS:(s,e)=>`${n.GUILD_SCHEDULED_EVENT(s,e)}/users`,GUILD_STICKER:(s,e)=>`${n.GUILD_STICKERS(s)}/${e}`,GUILD_STICKERS:s=>`${n.GUILD(s)}/stickers`,GUILD_TEMPLATE:(s,e)=>`${n.GUILD_TEMPLATES(s)}/${e}`,GUILD_THREADS_ACTIVE:s=>`${n.GUILD(s)}/threads/active`,GUILD_TEMPLATES:s=>`${n.GUILD(s)}/templates`,GUILD_VANITY:s=>`${n.GUILD(s)}/vanity-url`,GUILD_VOICE_REGIONS:s=>`${n.GUILD(s)}/regions`,GUILD_VOICE_STATE_USER:(s,e)=>`${n.GUILD(s)}/voice-states/${e}`,GUILD_WEBHOOKS:s=>`${n.GUILD(s)}/webhooks`,GUILD_WELCOME_SCREEN:s=>`${n.GUILD(s)}/welcome-screen`,GUILD_WIDGET:s=>`${n.GUILD(s)}/widget.json`,GUILD_WIDGET_SETTINGS:s=>`${n.GUILD(s)}/widget`,GUILDS:"/guilds",INTERACTION_CALLBACK:(s,e)=>`/interactions/${s}/${e}/callback`,INVITES:s=>`/invites/${s}`,OAUTH2_APPLICATION:s=>`/oauth2/applications/${s}`,STAGE_INSTANCE_CHANNEL:s=>`${n.STAGE_INSTANCES}/${s}`,STAGE_INSTANCES:"/stage-instances",STICKER:s=>`/stickers/${s}`,TEMPLATE:s=>`/guilds/templates/${s}`,USER:s=>`${n.USERS}/${s}`,USER_CHANNELS:s=>`${n.USER(s)}/channels`,USER_GUILD:(s,e)=>`${n.USER_GUILDS(s)}/${e}`,USER_GUILDS:s=>`${n.USER(s)}/guilds`,USERS:"/users",VOICE_REGIONS:"/voice/regions",WEBHOOK:s=>`/webhooks/${s}`,WEBHOOK_TOKEN:(s,e)=>`${n.WEBHOOK(s)}/${e}`,WEBHOOK_TOKEN_GITHUB:(s,e)=>`${n.WEBHOOK_TOKEN(s,e)}/github`,WEBHOOK_TOKEN_MESSAGE:(s,e,t)=>`/webhooks/${s}/${e}/messages/${t}`,WEBHOOK_TOKEN_SLACK:(s,e)=>`${n.WEBHOOK_TOKEN(s,e)}/slack`};ue.exports=n});function pe(s,e){return je.test(e)?`@${e}`:`@\u200B${e}`}var d,h,le,I,je,O=H(()=>{d=p(),h=A(),le=/@([^<>@ ]*)/gsmu,I=class{constructor(e,t){this.requestHandler=e,this.disableEveryone=t}async getChannel(e){return this.requestHandler.request(d.CHANNEL(e),"get","json")}async updateChannel(e,t){return this.requestHandler.request(d.CHANNEL(e),"patch","json",t)}async deleteChannel(e,t){return this.requestHandler.request(d.CHANNEL(e),"delete","json",t?{reason:t}:void 0)}async getChannelMessages(e,t={limit:50}){if(t.around?(delete t.before,delete t.after):t.before?(delete t.around,delete t.after):t.after&&(delete t.before,delete t.around),t.limit!==void 0&&(t.limit<h.GET_CHANNEL_MESSAGES_MIN_RESULTS||t.limit>h.GET_CHANNEL_MESSAGES_MAX_RESULTS))throw new RangeError(`Amount of messages that may be requested has to be between ${h.GET_CHANNEL_MESSAGES_MIN_RESULTS} and ${h.GET_CHANNEL_MESSAGES_MAX_RESULTS}`);return this.requestHandler.request(d.CHANNEL_MESSAGES(e),"get","json",t)}async getChannelMessage(e,t){return this.requestHandler.request(d.CHANNEL_MESSAGE(e,t),"get","json")}async createMessage(e,t,r={disableEveryone:this.disableEveryone}){if(typeof t!="string"&&!t.content&&!t.embeds&&!t.files)throw new Error("Missing content, embeds, files");return typeof t=="string"&&(t={content:t}),t.content&&(r.disableEveryone!==void 0?r.disableEveryone:this.disableEveryone)&&(t.content=t.content.replace(le,pe)),t.files?this.requestHandler.request(d.CHANNEL_MESSAGES(e),"post","multipart",t):this.requestHandler.request(d.CHANNEL_MESSAGES(e),"post","json",t)}async crosspostMessage(e,t){return this.requestHandler.request(d.CHANNEL_MESSAGE_CROSSPOST(e,t),"post","json")}async createReaction(e,t,r){return this.requestHandler.request(d.CHANNEL_MESSAGE_REACTION_USER(e,t,r,"@me"),"put","json")}async deleteReactionSelf(e,t,r){return this.requestHandler.request(d.CHANNEL_MESSAGE_REACTION_USER(e,t,r,"@me"),"delete","json")}async deleteReaction(e,t,r,i){return i?this.requestHandler.request(d.CHANNEL_MESSAGE_REACTION_USER(e,t,r,i),"delete","json"):this.requestHandler.request(d.CHANNEL_MESSAGE_REACTION(e,t,r),"delete","json")}async getReactions(e,t,r,i){return this.requestHandler.request(`${d.CHANNEL_MESSAGE_REACTION(e,t,r)}${i?Object.keys(i).map((o,u)=>`${u===0?"?":"&"}${o}=${i[o]}`).join(""):""}`,"get","json")}async deleteAllReactions(e,t){return this.requestHandler.request(d.CHANNEL_MESSAGE_REACTIONS(e,t),"delete","json")}async editMessage(e,t,r,i={disableEveryone:this.disableEveryone}){if(typeof r!="string"&&r.content===void 0&&r.embeds===void 0&&r.files===void 0)throw new Error("Missing content, embeds, or files");return typeof r=="string"&&(r={content:r}),r.content&&(i.disableEveryone!==void 0?i.disableEveryone:this.disableEveryone)&&(r.content=r.content.replace(le,pe)),r.files?this.requestHandler.request(d.CHANNEL_MESSAGE(e,t),"patch","multipart",r):this.requestHandler.request(d.CHANNEL_MESSAGE(e,t),"patch","json",r)}async deleteMessage(e,t,r){return this.requestHandler.request(d.CHANNEL_MESSAGE(e,t),"delete","json",r?{reason:r}:void 0)}async bulkDeleteMessages(e,t,r){if(t.length<h.BULK_DELETE_MESSAGES_MIN||t.length>h.BULK_DELETE_MESSAGES_MAX)throw new RangeError(`Amount of messages to be deleted has to be between ${h.BULK_DELETE_MESSAGES_MIN} and ${h.BULK_DELETE_MESSAGES_MAX}`);let i=BigInt(Date.now()-142128e7)*BigInt(2)**BigInt(22),o=t.find(m=>BigInt(m)<i);if(o)throw new Error(`The message ${o} is older than 2 weeks and may not be deleted using the bulk delete endpoint`);let u={messages:t};return r&&Object.assign(u,{reason:r}),this.requestHandler.request(d.CHANNEL_BULK_DELETE(e),"post","json",u)}async editChannelPermission(e,t,r){return this.requestHandler.request(d.CHANNEL_PERMISSION(e,t),"put","json",r)}async getChannelInvites(e){return this.requestHandler.request(d.CHANNEL_INVITES(e),"get","json")}async createChannelInvite(e,t={max_age:86400,max_uses:0,temporary:!1,unique:!1}){return this.requestHandler.request(d.CHANNEL_INVITES(e),"post","json",t)}async deleteChannelPermission(e,t,r){return this.requestHandler.request(d.CHANNEL_PERMISSION(e,t),"delete","json",r?{reason:r}:void 0)}async followNewsChannel(e,t){return this.requestHandler.request(d.CHANNEL_FOLLOWERS(e),"post","json",{webhook_channel_id:t})}async startChannelTyping(e){return this.requestHandler.request(d.CHANNEL_TYPING(e),"post","json")}async getChannelPinnedMessages(e){return this.requestHandler.request(d.CHANNEL_PINS(e),"get","json")}async addChannelPinnedMessage(e,t,r){return this.requestHandler.request(d.CHANNEL_PIN(e,t),"put","json",r?{reason:r}:void 0)}async removeChannelPinnedMessage(e,t,r){return this.requestHandler.request(d.CHANNEL_PIN(e,t),"delete","json",r?{reason:r}:void 0)}async createThreadWithMessage(e,t,r){return this.requestHandler.request(d.CHANNEL_MESSAGE_THREADS(e,t),"post","json",r)}async createThreadWithoutMessage(e,t){return this.requestHandler.request(d.CHANNEL_THREADS(e),"post","json",t)}async joinThread(e){return this.requestHandler.request(d.CHANNEL_THREAD_MEMBER(e,"@me"),"put","json")}async addThreadMember(e,t){return this.requestHandler.request(d.CHANNEL_THREAD_MEMBER(e,t),"put","json")}async leaveThread(e){return this.requestHandler.request(d.CHANNEL_THREAD_MEMBER(e,"@me"),"delete","json")}removeThreadMember(e,t){return this.requestHandler.request(d.CHANNEL_THREAD_MEMBER(e,t),"delete","json")}async getThreadMember(e,t){return this.requestHandler.request(d.CHANNEL_THREAD_MEMBER(e,t),"get","json")}async getThreadMembers(e){return this.requestHandler.request(d.CHANNEL_THREAD_MEMBERS(e),"get","json")}async getChannelArchivedPublicThreads(e,t){return this.requestHandler.request(`${d.CHANNEL_THREADS_ARCHIVED_PUBLIC(e)}${t?Object.keys(t).map((r,i)=>`${i===0?"?":"&"}${r}=${t[r]}`).join(""):""}`,"get","json")}async getChannelArchivedPrivateThreads(e,t){return this.requestHandler.request(`${d.CHANNEL_THREADS_ARCHIVED_PRIVATE(e)}${t?Object.keys(t).map((r,i)=>`${i===0?"?":"&"}${r}=${t[r]}`).join(""):""}`,"get","json")}async getChannelArchivedPrivateThreadsUser(e,t){return this.requestHandler.request(`${d.CHANNEL_THREADS_ARCHIVED_PRIVATE_USER(e)}${t?Object.keys(t).map((r,i)=>`${i===0?"?":"&"}${r}=${t[r]}`).join(""):""}`,"get","json")}},je=/^[&!]?\d+$/});var y,G,j=H(()=>{y=p(),G=class{constructor(e){this.requestHandler=e}async getEmojis(e){return this.requestHandler.request(y.GUILD_EMOJIS(e),"get","json")}async getEmoji(e,t){return this.requestHandler.request(y.GUILD_EMOJI(e,t),"get","json")}async createEmoji(e,t){return this.requestHandler.request(y.GUILD_EMOJIS(e),"post","json",t)}async updateEmoji(e,t,r){return this.requestHandler.request(y.GUILD_EMOJI(e,t),"patch","json",r)}async deleteEmoji(e,t,r){return this.requestHandler.request(y.GUILD_EMOJI(e,t),"delete","json",r?{reason:r}:void 0)}async getSticker(e){return this.requestHandler.request(y.STICKER(e),"get","json")}async getGuildStickers(e){return this.requestHandler.request(y.GUILD_STICKERS(e),"get","json")}async getGuildSticker(e,t){return this.requestHandler.request(y.GUILD_STICKER(e,t),"get","json")}createGuildSticker(e,t){return this.requestHandler.request(y.GUILD_STICKERS(e),"post","multipart",t)}updateGuildSticker(e,t,r){return this.requestHandler.request(y.GUILD_STICKER(e,t),"patch","json",r)}deleteGuildSticker(e,t,r){return this.requestHandler.request(y.GUILD_STICKER(e,t),"delete","json",r?{reason:r}:void 0)}}});var a,R,T,k=H(()=>{a=p(),R=A(),T=class{constructor(e){this.requestHandler=e}async createGuild(e){return this.requestHandler.request(a.GUILDS,"post","json",e)}async getGuild(e,t){return this.requestHandler.request(`${a.GUILD(e)}${t!==void 0?`?with_counts=${t}`:""}`,"get","json")}async getGuildPreview(e){return this.requestHandler.request(a.GUILD_PREVIEW(e),"get","json")}async updateGuild(e,t){return this.requestHandler.request(a.GUILD(e),"patch","json",t)}async deleteGuild(e){return this.requestHandler.request(a.GUILD(e),"delete","json")}async getGuildChannels(e){return this.requestHandler.request(a.GUILD_CHANNELS(e),"get","json")}async createGuildChannel(e,t){return this.requestHandler.request(a.GUILD_CHANNELS(e),"post","json",t)}async updateChannelPositions(e,t){return this.requestHandler.request(a.GUILD_CHANNELS(e),"patch","json",t)}async listActiveThreads(e){return this.requestHandler.request(a.GUILD_THREADS_ACTIVE(e),"get","json")}async getGuildMember(e,t){return this.requestHandler.request(a.GUILD_MEMBER(e,t),"get","json")}async getGuildMembers(e,t){return this.requestHandler.request(a.GUILD_MEMBERS(e),"get","json",t)}async searchGuildMembers(e,t){if(t.limit!==void 0&&(t.limit<R.SEARCH_MEMBERS_MIN_RESULTS||t.limit>R.SEARCH_MEMBERS_MAX_RESULTS))throw new RangeError(`Limit for searching guild members has to be between ${R.SEARCH_MEMBERS_MIN_RESULTS} and ${R.SEARCH_MEMBERS_MAX_RESULTS}`);return this.requestHandler.request(a.GUILD_MEMBERS_SEARCH(e),"get","json",t)}async addGuildMember(e,t,r){return this.requestHandler.request(a.GUILD_MEMBER(e,t),"put","json",r)}async updateGuildMember(e,t,r){return this.requestHandler.request(a.GUILD_MEMBER(e,t),"patch","json",r)}async updateSelf(e,t){return this.requestHandler.request(a.GUILD_MEMBER(e,"@me"),"patch","json",t)}async addGuildMemberRole(e,t,r,i){return this.requestHandler.request(a.GUILD_MEMBER_ROLE(e,t,r),"put","json",i)}async removeGuildMemberRole(e,t,r,i){return this.requestHandler.request(a.GUILD_MEMBER_ROLE(e,t,r),"delete","json",i?{reason:i}:void 0)}async removeGuildMember(e,t,r){return this.requestHandler.request(a.GUILD_MEMBER(e,t),"delete","json",r?{reason:r}:void 0)}async getGuildBans(e,t){return this.requestHandler.request(`${a.GUILD_BANS(e)}${t?Object.keys(t).map((r,i)=>`${i===0?"?":"&"}${r}=${t[r]}`):""}`,"get","json")}async getGuildBan(e,t){return this.requestHandler.request(a.GUILD_BAN(e,t),"get","json")}async createGuildBan(e,t,r){return this.requestHandler.request(a.GUILD_BAN(e,t),"put","json",r)}async removeGuildBan(e,t,r){return this.requestHandler.request(a.GUILD_BAN(e,t),"delete","json",r?{reason:r}:void 0)}async getGuildRoles(e){return this.requestHandler.request(a.GUILD_ROLES(e),"get","json")}async createGuildRole(e,t){return this.requestHandler.request(a.GUILD_ROLES(e),"post","json",t)}async updateGuildRolePositions(e,t){return this.requestHandler.request(a.GUILD_ROLES(e),"patch","json",t)}async updateGuildRole(e,t,r){return this.requestHandler.request(a.GUILD_ROLE(e,t),"patch","json",r)}async removeGuildRole(e,t,r){return this.requestHandler.request(a.GUILD_ROLE(e,t),"delete","json",r?{reason:r}:void 0)}async getGuildPruneCount(e,t){return this.requestHandler.request(`${a.GUILD_PRUNE(e)}${t?Object.keys(t).map((r,i)=>`${i===0?"?":"&"}${r}=${t[r]}`).join(""):""}`,"get","json")}async startGuildPrune(e,t){return this.requestHandler.request(a.GUILD_PRUNE(e),"post","json",t)}async getGuildVoiceRegions(e){return this.requestHandler.request(a.GUILD_VOICE_REGIONS(e),"get","json")}async getGuildInvites(e){return this.requestHandler.request(a.GUILD_INVITES(e),"get","json")}async getGuildIntegrations(e){return this.requestHandler.request(a.GUILD_INTEGRATIONS(e),"get","json")}async removeGuildIntegration(e,t,r){return this.requestHandler.request(a.GUILD_INTEGRATION(e,t),"delete","json",r?{reason:r}:void 0)}async getGuildWidgetSettings(e){return this.requestHandler.request(a.GUILD_WIDGET_SETTINGS(e),"get","json")}async updateGuildWidgetSettings(e,t){return this.requestHandler.request(a.GUILD_WIDGET_SETTINGS(e),"patch","json",t)}async getGuildWidget(e){return this.requestHandler.request(a.GUILD_WIDGET(e),"get","json")}async getGuildVanityURL(e){return this.requestHandler.request(a.GUILD_VANITY(e),"get","json")}async getGuildWelcomeScreen(e){return this.requestHandler.request(a.GUILD_WELCOME_SCREEN(e),"get","json")}async editGuildWelcomeScreen(e,t){return this.requestHandler.request(a.GUILD_WELCOME_SCREEN(e),"patch","json",t)}updateCurrentUserVoiceState(e,t){return this.requestHandler.request(a.GUILD_VOICE_STATE_USER(e,"@me"),"patch","json",t)}updateUserVoiceState(e,t,r){return this.requestHandler.request(a.GUILD_VOICE_STATE_USER(e,t),"patch","json",r)}}});var L,M,q,w=H(()=>{L=p(),M=A(),q=class{constructor(e){this.requestHandler=e}async listGuildScheduledEvents(e,t){return this.requestHandler.request(`${L.GUILD_SCHEDULED_EVENTS(e)}${t?"?with_user_count=true":""}`,"get","json")}async createGuildScheduledEvent(e,t){return this.requestHandler.request(L.GUILD_SCHEDULED_EVENTS(e),"post","json",t)}async getGuildScheduledEvent(e,t,r){return this.requestHandler.request(`${L.GUILD_SCHEDULED_EVENT(e,t)}${r?"?with_user_count=true":""}`,"get","json")}async editGuildScheduledEvent(e,t,r){return this.requestHandler.request(L.GUILD_SCHEDULED_EVENT(e,t),"patch","json",r)}async deleteGuildScheduledEvent(e,t){return this.requestHandler.request(L.GUILD_SCHEDULED_EVENT(e,t),"delete","json")}async getGuildScheduledEventUsers(e,t,r){if((r==null?void 0:r.limit)!==void 0&&(r.limit<M.GET_GUILD_SCHEDULED_EVENT_USERS_MIN_RESULTS||r.limit>M.GET_GUILD_SCHEDULED_EVENT_USERS_MAX_RESULTS))throw new RangeError(`The maximum amount of users that may be requested has to be between ${M.GET_GUILD_SCHEDULED_EVENT_USERS_MIN_RESULTS} and ${M.GET_GUILD_SCHEDULED_EVENT_USERS_MAX_RESULTS}`);return this.requestHandler.request(`${L.GUILD_SCHEDULED_EVENT_USERS(e,t)}${r?Object.keys(r).map((i,o)=>`${o===0?"?":"&"}${i}=${r[i]}`).join(""):""}`,"get","json")}}});function ge(s,e){return ke.test(e)?`@${e}`:`@\u200B${e}`}var g,ce,C,ke,B=H(()=>{g=p(),ce=/@([^<>@ ]*)/gsmu,C=class{constructor(e,t){this.requestHandler=e,this.disableEveryone=t}async createWebhook(e,t){return this.requestHandler.request(g.CHANNEL_WEBHOOKS(e),"post","json",t)}async getChannelWebhooks(e){return this.requestHandler.request(g.CHANNEL_WEBHOOKS(e),"get","json")}async getGuildWebhooks(e){return this.requestHandler.request(g.GUILD_WEBHOOKS(e),"get","json")}async getWebhook(e,t){return t?this.requestHandler.request(g.WEBHOOK_TOKEN(e,t),"get","json"):this.requestHandler.request(g.WEBHOOK(e),"get","json")}async updateWebhook(e,t,r){return t?this.requestHandler.request(g.WEBHOOK_TOKEN(e,t),"patch","json",r):this.requestHandler.request(g.WEBHOOK(e),"patch","json",r)}async deleteWebhook(e,t){return t?this.requestHandler.request(g.WEBHOOK_TOKEN(e,t),"delete","json"):this.requestHandler.request(g.WEBHOOK(e),"delete","json")}async executeWebhook(e,t,r,i={disableEveryone:this.disableEveryone}){if(typeof r!="string"&&!(r!=null&&r.content)&&!(r!=null&&r.embeds)&&!(r!=null&&r.files))throw new Error("Missing content or embeds or files");return typeof r=="string"&&(r={content:r}),r.content&&((i==null?void 0:i.disableEveryone)!==void 0?i.disableEveryone:this.disableEveryone)&&(r.content=r.content.replace(ce,ge)),i&&(delete i.disableEveryone,Object.keys(i).length===0&&(i=void 0)),this.requestHandler.request(`${g.WEBHOOK_TOKEN(e,t)}${i?Object.keys(i).map((o,u)=>`${u===0?"?":"&"}${o}=${i[o]}`).join(""):""}`,"post",r.files?"multipart":"json",r)}async executeWebhookSlack(e,t,r,i={disableEveryone:this.disableEveryone}){return r.text&&((i==null?void 0:i.disableEveryone)!==void 0?i.disableEveryone:this.disableEveryone)&&(r.text=r.text.replace(ce,ge)),i&&(delete i.disableEveryone,Object.keys(i).length===0&&(i=void 0)),this.requestHandler.request(`${g.WEBHOOK_TOKEN_SLACK(e,t)}${i?Object.keys(i).map((o,u)=>`${u===0?"?":"&"}${o}=${i[o]}`).join(""):""}`,"post","json",r)}async executeWebhookGitHub(e,t,r,i){return this.requestHandler.request(`${g.WEBHOOK_TOKEN_GITHUB(e,t)}${i?Object.keys(i).map((o,u)=>`${u===0?"?":"&"}${o}=${i[o]}`).join(""):""}`,"post","json",r)}async getWebhookMessage(e,t,r,i){return this.requestHandler.request(`${g.WEBHOOK_TOKEN_MESSAGE(e,t,r)}${i?`?thread_id=${i}`:""}`,"get","json")}async editWebhookMessage(e,t,r,i){let o;return i.thread_id&&(o=i.thread_id),delete i.thread_id,this.requestHandler.request(`${g.WEBHOOK_TOKEN_MESSAGE(e,t,r)}${o?`?thread_id=${o}`:""}`,"patch",i.files?"multipart":"json",i)}async deleteWebhookMessage(e,t,r,i){return this.requestHandler.request(`${g.WEBHOOK_TOKEN_MESSAGE(e,t,r)}${i?`?thread_id=${i}`:""}`,"delete","json")}},ke=/^[&!]?\d+$/});var x=E((Mt,me)=>{var we=p(),W=class{constructor(e){this.requestHandler=e}async getAuditLog(e,t){return this.requestHandler.request(we.GUILD_AUDIT_LOGS(e),"get","json",t)}};me.exports=W});var V=E((ft,ye)=>{var Ee=p(),K=class{constructor(e){this.requestHandler=e}getGateway(){return this.requestHandler.request(Ee.GATEWAY,"get","json")}getGatewayBot(){return this.requestHandler.request(Ee.GATEWAY_BOT,"get","json")}};ye.exports=K});var J=E((Dt,he)=>{var S=p(),F=class{constructor(e){this.requestHandler=e}getGuildTemplate(e){return this.requestHandler.request(S.TEMPLATE(e),"get","json")}createGuildFromGuildTemplate(e,t){return this.requestHandler.request(S.TEMPLATE(e),"post","json",t)}getGuildTemplates(e){return this.requestHandler.request(S.GUILD_TEMPLATES(e),"get","json")}createGuildTemplate(e,t){return this.requestHandler.request(S.GUILD_TEMPLATES(e),"post","json",t)}syncGuildTemplate(e,t){return this.requestHandler.request(S.GUILD_TEMPLATE(e,t),"put","json")}modifyGuildTemplate(e,t,r){return this.requestHandler.request(S.GUILD_TEMPLATE(e,t),"patch","json",r)}deleteGuildTemplate(e,t){return this.requestHandler.request(S.GUILD_TEMPLATE(e,t),"delete","json")}};he.exports=F});var Q=E((Pt,_e)=>{var c=p(),X=class{constructor(e,t){this.requestHandler=e,this.webhooks=t}getApplicationCommands(e,t){return this.requestHandler.request(`${c.APPLICATION_COMMANDS(e)}${t?"?with_localizations=true":""}`,"get","json")}createApplicationCommand(e,t){return this.requestHandler.request(c.APPLICATION_COMMANDS(e),"post","json",t)}getApplicationCommand(e,t){return this.requestHandler.request(c.APPLICATION_COMMAND(e,t),"get","json")}editApplicationCommand(e,t,r){return this.requestHandler.request(c.APPLICATION_COMMAND(e,t),"patch","json",r)}deleteApplicationCommand(e,t){return this.requestHandler.request(c.APPLICATION_COMMAND(e,t),"delete","json")}bulkOverwriteApplicationCommands(e,t){return this.requestHandler.request(c.APPLICATION_COMMANDS(e),"put","json",t)}getGuildApplicationCommands(e,t,r){return this.requestHandler.request(`${c.APPLICATION_GUILD_COMMANDS(e,t)}${r?"?with_localizations=true":""}`,"get","json")}createGuildApplicationCommand(e,t,r){return this.requestHandler.request(c.APPLICATION_GUILD_COMMANDS(e,t),"post","json",r)}getGuildApplicationCommand(e,t,r){return this.requestHandler.request(c.APPLICATION_GUILD_COMMAND(e,t,r),"get","json")}editGuildApplicationCommand(e,t,r,i){return this.requestHandler.request(c.APPLICATION_GUILD_COMMAND(e,t,r),"patch","json",i)}deleteGuildApplicationCommand(e,t,r){return this.requestHandler.request(c.APPLICATION_GUILD_COMMAND(e,t,r),"delete","json")}bulkOverwriteGuildApplicationCommands(e,t,r){return this.requestHandler.request(c.APPLICATION_GUILD_COMMANDS(e,t),"put","json",r)}getGuildApplicationCommandPermissions(e,t,r){return r?this.requestHandler.request(c.APPLICATION_GUILD_COMMAND_PERMISSIONS(e,t,r),"get","json"):this.requestHandler.request(c.APPLICATION_GUILD_COMMANDS_PERMISSIONS(e,t),"get","json")}editGuildApplicationCommandPermissions(e,t,r,i){let o={permissions:i};return this.requestHandler.request(c.APPLICATION_GUILD_COMMAND_PERMISSIONS(e,t,r),"put","json",o)}createInteractionResponse(e,t,r){return this.requestHandler.request(c.INTERACTION_CALLBACK(e,t),"post",r.files?"multipart":"json",r)}getOriginalInteractionResponse(e,t){return this.webhooks.getWebhookMessage(e,t,"@original")}editOriginalInteractionResponse(e,t,r){return this.webhooks.editWebhookMessage(e,t,"@original",r)}deleteOriginalInteractionResponse(e,t){return this.webhooks.deleteWebhookMessage(e,t,"@original")}createFollowupMessage(e,t,r){return this.webhooks.executeWebhook(e,t,r)}getFollowupMessage(e,t,r){return this.webhooks.getWebhookMessage(e,t,r)}editFollowupMessage(e,t,r,i){return this.webhooks.editWebhookMessage(e,t,r,i)}deleteFollowupMessage(e,t,r){return this.webhooks.deleteWebhookMessage(e,t,r)}};_e.exports=X});var z=E((Ut,Ae)=>{var be=p(),Y=class{constructor(e){this.requestHandler=e}async getInvite(e,t){return this.requestHandler.request(`${be.INVITES(e)}${t?Object.keys(t).map((r,i)=>`${i===0?"?":"&"}${r}=${t[r]}`).join(""):""}`,"get","json")}async deleteInvite(e){return this.requestHandler.request(be.INVITES(e),"delete","json")}};Ae.exports=Y});var ee=E((vt,Se)=>{var f=p(),Z=class{constructor(e){this.requestHandler=e}async createStageInstance(e){return this.requestHandler.request(f.STAGE_INSTANCES,"post","json",e)}async getStageInstance(e){return this.requestHandler.request(f.STAGE_INSTANCE_CHANNEL(e),"get","json")}async editStageInstance(e,t){return this.requestHandler.request(f.STAGE_INSTANCE_CHANNEL(e),"patch","json",t)}async deleteStageInstance(e,t){return this.requestHandler.request(f.STAGE_INSTANCE_CHANNEL(e),"delete","json",t?{reason:t}:void 0)}};Se.exports=Z});var re=E(($t,He)=>{var N=p(),te=class{constructor(e){this.requestHandler=e}async getSelf(){return this.requestHandler.request(N.USER("@me"),"get","json")}async getUser(e){return this.requestHandler.request(N.USER(e),"get","json")}async updateSelf(e){return this.requestHandler.request(N.USER("@me"),"patch","json",e)}async getGuilds(e){return this.requestHandler.request(`${N.USER_GUILDS("@me")}${e?Object.keys(e).map((t,r)=>`${r===0?"?":"&"}${t}=${e[t]}`).join(""):""}`,"get","json")}async leaveGuild(e){return this.requestHandler.request(N.USER_GUILD("@me",e),"delete","json")}async createDirectMessageChannel(e){return this.requestHandler.request(N.USER_CHANNELS("@me"),"post","json",{recipient_id:e})}};He.exports=te});var ie=E((Ot,Le)=>{var Be=p(),se=class{constructor(e){this.requestHandler=e}async getVoiceRegions(){return this.requestHandler.request(Be.VOICE_REGIONS,"get","json")}};Le.exports=se});var Ne=E((jt,We)=>{We.exports={name:"snowtransfer",version:"0.6.1",description:"Minimalistic Rest client for the Discord Api",main:"./dist/index.js",types:"./dist/index.d.ts",engines:{node:">=12.0.0"},keywords:["discord","api","rest","http","microservice","discord bot","discord bot microservice","microservice bot"],scripts:{"build:src":"tsup src/index.ts --dts --sourcemap --format cjs --target node12 --minify","build:docs":"typedoc --name SnowTransfer --excludeExternals --sort static-first --sort alphabetical"},repository:{type:"git",url:"git+https://github.com/DasWolke/SnowTransfer.git"},bugs:"https://github.com/DasWolke/SnowTransfer/issues",author:"wolke <wolke@weeb.sh>",license:"MIT",dependencies:{centra:"^2.6.0","discord-typings":"^10.4.1","form-data":"^4.0.0"},devDependencies:{"@types/centra":"^2.2.0","@types/node":"^18.11.9","@typescript-eslint/eslint-plugin":"^5.43.0","@typescript-eslint/parser":"^5.43.0",eslint:"^8.28.0",tsup:"^6.5.0",typedoc:"^0.23.21","typedoc-plugin-mdn-links":"^2.0.0",typescript:"^4.9.3"},files:["dist","README.md","LICENSE.md"]}});var Ge,xe,Ke,Ie,ne,Ve,Fe,Je,Xe,Qe,Ye,ze,Ze,et,tt,rt,D,P,oe,U,Te=H(()=>{Ge=require("events"),xe=require("crypto"),Ke=require("form-data"),Ie=require("centra"),ne=p(),{version:Ve}=Ne(),Fe=A(),Je=/\/bans/,Xe=/\/prune/,Qe=/application\/json/,Ye=/\/([a-z-]+)\/(?:\d{17,19})/g,ze=/\/reactions\/[^/]+/g,Ze=/\/reactions\/:id\/[^/]+/g,et=/^\/webhooks\/(\d+)\/[A-Za-z0-9-_]{64,}/,tt=/\/messages\/:id$/,rt=/\/guilds\/\d+\/channels$/,D=class extends Error{constructor(t,r,i,o){var u;super();this.name="DiscordAPIError",this.message=r.message||String(r),this.method=i,this.path=t,this.code=(u=r.code)!=null?u:4e3,this.httpStatus=o}},P=class{constructor(){this.buckets={};this._global=!1;this.globalReset=0;this.globalResetTimeout=null}get global(){return this._global}set global(e){if(e&&this.globalReset!==0){this.globalResetTimeout&&clearTimeout(this.globalResetTimeout);let t=this;this.globalResetTimeout=setTimeout(()=>{t.global=!1},this.globalReset).unref()}else{this.globalResetTimeout&&clearTimeout(this.globalResetTimeout),this.globalResetTimeout=null,this.globalReset=0;for(let t of Object.values(this.buckets))t.checkQueue()}this._global=e}routify(e,t){let r=e.replace(Ye,function(i,o){return o==="channels"||o==="guilds"||o==="webhooks"?i:`/${o}/:id`}).replace(ze,"/reactions/:id").replace(Ze,"/reactions/:id/:userID").replace(et,"/webhooks/$1/:token");if(t.toUpperCase()==="DELETE"&&tt.test(r)?r=t+r:t.toUpperCase()==="GET"&&rt.test(r)&&(r="/guilds/:id/channels"),t==="PUT"||t==="DELETE"){let i=r.indexOf("/reactions");i!==-1&&(r="MODIFY"+r.slice(0,i+10))}return r}queue(e,t,r){let i=this.routify(t,r);this.buckets[i]||(this.buckets[i]=new oe(this,i)),this.buckets[i].queue(e)}},oe=class{constructor(e,t){this.fnQueue=[];this.limit=5;this.remaining=1;this.reset=5e3;this.resetTimeout=null;this.ratelimiter=e,this.routeKey=t}queue(e){return new Promise(t=>{let r=()=>(this.remaining--,this.resetTimeout||(this.resetTimeout=setTimeout(()=>this.resetRemaining(),this.reset)),this.remaining!==0&&this.checkQueue(),t(e(this)));this.fnQueue.push({fn:e,callback:r}),this.checkQueue()})}checkQueue(){this.ratelimiter.global||this.fnQueue.length&&this.remaining!==0&&this.fnQueue.splice(0,1)[0].callback()}resetRemaining(){this.remaining=this.limit,this.resetTimeout&&(clearTimeout(this.resetTimeout),this.resetTimeout=null),this.fnQueue.length?this.checkQueue():delete this.ratelimiter.buckets[this.routeKey]}dropQueue(){this.fnQueue.length=0}},U=class extends Ge.EventEmitter{constructor(t,r){super();this.ratelimiter=t,this.options={baseHost:ne.BASE_HOST,baseURL:ne.BASE_URL,headers:{"User-Agent":`Discordbot (https://github.com/DasWolke/SnowTransfer, ${Ve}) Node.js/${process.version}`}},r.token&&(this.options.headers.Authorization=r.token),this.options.baseHost=r.baseHost,this.apiURL=this.options.baseHost+ne.BASE_URL,this.latency=500}request(t,r,i="json",o){return typeof o=="number"&&(o=String(o)),new Promise(async(u,m)=>{this.ratelimiter.queue(async _=>{let v=xe.randomBytes(20).toString("hex");try{this.emit("request",v,{endpoint:t,method:r,dataType:i,data:o!=null?o:{}});let l;if(i=="json")l=await this._request(t,r,o,r==="get"||Je.test(t)||Xe.test(t));else if(i=="multipart")l=await this._multiPartRequest(t,r,o);else throw new Error("Forbidden dataType. Use json or multipart");if(l.statusCode&&!Fe.OK_STATUS_CODES.includes(l.statusCode)&&l.statusCode!==429)throw new D(t,l.headers["content-type"]&&Qe.test(l.headers["content-type"])?{message:JSON.stringify(await l.json())}:{message:String(l.body)},r,l.statusCode);if(this._applyRatelimitHeaders(_,l.headers),l.statusCode===429){if(!this.ratelimiter.global){let b=JSON.parse(String(l.body));b.reset_after!==void 0?this.ratelimiter.globalReset=b.reset_after*1e3:this.ratelimiter.globalReset=1e3,b.global!==void 0&&(this.ratelimiter.global=b.global)}throw this.emit("rateLimit",{timeout:_.reset,limit:_.limit,method:r,path:t,route:this.ratelimiter.routify(t,r)}),new D(t,{message:"You're being ratelimited",code:429},r,l.statusCode)}if(this.emit("done",v,l),l.body){let b;try{b=JSON.parse(l.body.toString())}catch{u(void 0)}return u(b)}else return u(void 0)}catch(l){return this.emit("requestError",v,l),m(l)}},t,r)})}_applyRatelimitHeaders(t,r){r["x-ratelimit-remaining"]&&(t.remaining=parseInt(r["x-ratelimit-remaining"])),r["x-ratelimit-limit"]&&(t.limit=parseInt(r["x-ratelimit-limit"])),r["x-ratelimit-reset"]&&(t.reset=parseInt(r["x-ratelimit-reset"])-Date.now())}async _request(t,r,i,o=!1){let u={...this.options.headers};typeof i!="string"&&(i==null?void 0:i.reason)&&(u["X-Audit-Log-Reason"]=encodeURIComponent(i.reason),delete i.reason);let m=Ie(this.apiURL,r).path(t).header({...this.options.headers,...u});return o?m.query(i).send():(i&&typeof i=="object"?m.body(i,"json"):i&&m.body(i),m.send())}async _multiPartRequest(t,r,i){let o=new Ke;if(i.files&&Array.isArray(i.files)&&i.files.every(m=>!!m.name&&!!m.file)){let m=0;for(let _ of i.files)o.append(`files[${m}]`,_.file,{filename:_.name}),delete _.file,m++}i.data&&delete i.files,o.append("payload_json",JSON.stringify(i));let u={...this.options.headers,...o.getHeaders()};return Ie(this.apiURL,r).path(t).header(u).body(o.getBuffer()).timeout(15e3).send()}}});var Re=E((Ft,Ce)=>{Te();O();j();B();k();w();var st=re(),it=J(),nt=Q(),ot=z(),at=ie(),dt=V(),ut=x(),lt=ee(),qe=p(),ae=class{constructor(e,t){if(typeof e=="string"&&e==="")throw new Error("Missing token");e&&!e.startsWith("Bot")&&!e.startsWith("Bearer")&&(e=`Bot ${e}`),this.options={baseHost:qe.BASE_HOST,disableEveryone:!1},this.token=e,Object.assign(this.options,t),this.ratelimiter=new P,this.requestHandler=new U(this.ratelimiter,{token:this.token,baseHost:this.options.baseHost||qe.BASE_HOST}),this.channel=new I(this.requestHandler,this.options.disableEveryone),this.user=new st(this.requestHandler),this.guildAssets=new G(this.requestHandler),this.webhook=new C(this.requestHandler,this.options.disableEveryone),this.guild=new T(this.requestHandler),this.guildScheduledEvent=new q(this.requestHandler),this.guildTemplate=new it(this.requestHandler),this.interaction=new nt(this.requestHandler,this.webhook),this.invite=new ot(this.requestHandler),this.voice=new at(this.requestHandler),this.bot=new dt(this.requestHandler),this.auditLog=new ut(this.requestHandler),this.stageInstance=new lt(this.requestHandler)}};Ce.exports=ae});var Ht={};Pe(Ht,{AuditLogMethods:()=>pt,BotMethods:()=>ct,ChannelMethods:()=>I,Constants:()=>bt,Endpoints:()=>At,GuildAssetsMethods:()=>G,GuildMethods:()=>T,GuildScheduledEventMethods:()=>q,GuildTemplateMethods:()=>gt,InteractionMethods:()=>mt,InviteMethods:()=>Et,SnowTransfer:()=>St,StageInstanceMethods:()=>yt,UserMethods:()=>ht,VoiceMethods:()=>_t,WebhookMethods:()=>C});module.exports=ve(Ht);O();j();k();w();B();var pt=x(),ct=V(),gt=J(),mt=Q(),Et=z(),yt=ee(),ht=re(),_t=ie(),bt=A(),At=p(),St=Re();0&&(module.exports={AuditLogMethods,BotMethods,ChannelMethods,Constants,Endpoints,GuildAssetsMethods,GuildMethods,GuildScheduledEventMethods,GuildTemplateMethods,InteractionMethods,InviteMethods,SnowTransfer,StageInstanceMethods,UserMethods,VoiceMethods,WebhookMethods}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "snowtransfer", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Minimalistic Rest client for the Discord Api", | ||
@@ -32,2 +32,3 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"centra": "^2.6.0", | ||
"discord-typings": "^10.4.1", | ||
@@ -37,2 +38,3 @@ "form-data": "^4.0.0" | ||
"devDependencies": { | ||
"@types/centra": "^2.2.0", | ||
"@types/node": "^18.11.9", | ||
@@ -39,0 +41,0 @@ "@typescript-eslint/eslint-plugin": "^5.43.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
0
462314
3
9
3954
+ Addedcentra@^2.6.0
+ Addedcentra@2.7.0(transitive)
+ Addedfollow-redirects@1.15.9(transitive)