From 49953e4b9b725c975bba80cf5931eceb679e5aef Mon Sep 17 00:00:00 2001 From: Travis CI Date: Thu, 30 Mar 2017 15:03:21 +0000 Subject: [PATCH] Webpack build for branch master: dd3831fa1e8845f8800f1c6a37ee92f30c1e1c58 --- discord.master.js | 1 - discord.master.min.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/discord.master.js b/discord.master.js index 70f09e66..bb815d17 100644 --- a/discord.master.js +++ b/discord.master.js @@ -736,7 +736,6 @@ class Collection extends Map { * } */ exists(prop, value) { - if (prop === 'id') throw new RangeError('Don\'t use .exists() with IDs. Instead, use .has(id).'); return Boolean(this.find(prop, value)); } diff --git a/discord.master.min.js b/discord.master.min.js index ab92ea0c..b5845820 100644 --- a/discord.master.min.js +++ b/discord.master.min.js @@ -1,4 +1,4 @@ -!function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=145)}([function(t,e,n){(function(t){e.Package=n(28),e.DefaultOptions={apiRequestMethod:"sequential",shardId:0,shardCount:0,messageCacheMaxSize:200,messageCacheLifetime:0,messageSweepInterval:0,fetchAllMembers:!1,disableEveryone:!1,sync:!1,restWsBridgeTimeout:5e3,disabledEvents:[],restTimeOffset:500,ws:{large_threshold:250,compress:"browser"!==n(15).platform(),properties:{$os:t?t.platform:"discord.js",$browser:"discord.js",$device:"discord.js",$referrer:"",$referring_domain:""}}},e.Errors={NO_TOKEN:"Request to use token, but token was unavailable to the client.",NO_BOT_ACCOUNT:"Only bot accounts are able to make use of this feature.",NO_USER_ACCOUNT:"Only user accounts are able to make use of this feature.",BAD_WS_MESSAGE:"A bad message was received from the websocket; either bad compression, or not JSON.",TOOK_TOO_LONG:"Something took too long to do.",NOT_A_PERMISSION:"Invalid permission string or number.",INVALID_RATE_LIMIT_METHOD:"Unknown rate limiting method.",BAD_LOGIN:"Incorrect login details were provided.",INVALID_SHARD:"Invalid shard settings were provided.",SHARDING_REQUIRED:"This session would have handled too many guilds - Sharding is required.",INVALID_TOKEN:"An invalid token was provided."};const i=e.PROTOCOL_VERSION=6,s=e.HOST=`https://discordapp.com`,r=e.API=`${s}/api/v${i}`,o=e.Endpoints={login:`${r}/auth/login`,logout:`${r}/auth/logout`,gateway:`${r}/gateway`,botGateway:`${r}/gateway/bot`,invite:t=>`${r}/invite/${t}`,inviteLink:t=>`https://discord.gg/${t}`,assets:t=>`${s}/assets/${t}`,CDN:"https://cdn.discordapp.com",user:t=>`${r}/users/${t}`,userChannels:t=>`${o.user(t)}/channels`,userProfile:t=>`${o.user(t)}/profile`,avatar:(t,e)=>{return"1"===t?e:`${o.CDN}/avatars/${t}/${e}.${e.startsWith("a_")?"gif":"jpg"}?size=1024`},me:`${r}/users/@me`,meGuild:t=>`${o.me}/guilds/${t}`,meChannels:`${r}/users/@me/channels`,meMentions:(t,e,n,i)=>`users/@me/mentions?limit=${t}&roles=${e}&everyone=${n}${i?`&guild_id=${i}`:""}`,relationships:t=>`${o.user(t)}/relationships`,note:t=>`${o.me}/notes/${t}`,voiceRegions:`${r}/voice/regions`,guilds:`${r}/guilds`,guild:t=>`${o.guilds}/${t}`,guildIcon:(t,e)=>`${o.CDN}/icons/${t}/${e}.jpg`,guildSplash:(t,e)=>`${o.CDN}/splashes/${t}/${e}.jpg`,guildPrune:t=>`${o.guild(t)}/prune`,guildEmbed:t=>`${o.guild(t)}/embed`,guildInvites:t=>`${o.guild(t)}/invites`,guildRoles:t=>`${o.guild(t)}/roles`,guildRole:(t,e)=>`${o.guildRoles(t)}/${e}`,guildBans:t=>`${o.guild(t)}/bans`,guildIntegrations:t=>`${o.guild(t)}/integrations`,guildMembers:t=>`${o.guild(t)}/members`,guildMember:(t,e)=>`${o.guildMembers(t)}/${e}`,guildMemberRole:(t,e,n)=>`${o.guildMember(t,e)}/roles/${n}`,guildMemberNickname:t=>`${o.guildMember(t,"@me")}/nick`,guildChannels:t=>`${o.guild(t)}/channels`,guildEmojis:t=>`${o.guild(t)}/emojis`,guildEmoji:(t,e)=>`${o.guildEmojis(t)}/${e}`,guildSearch:t=>`${o.guild(t)}/messages/search`,guildVoiceRegions:t=>`${o.guild(t)}/regions`,guildWebhooks:t=>`${o.guild(t)}/webhooks`,channels:`${r}/channels`,channel:t=>`${o.channels}/${t}`,channelMessages:t=>`${o.channel(t)}/messages`,channelInvites:t=>`${o.channel(t)}/invites`,channelTyping:t=>`${o.channel(t)}/typing`,channelPermissions:t=>`${o.channel(t)}/permissions`,channelMessage:(t,e)=>`${o.channelMessages(t)}/${e}`,channelWebhooks:t=>`${o.channel(t)}/webhooks`,channelSearch:t=>`${o.channelMessages(t)}/search`,dmChannelRecipient:(t,e)=>`${o.channel(t)}/recipients/${e}`,messageReactions:(t,e)=>`${o.channelMessage(t,e)}/reactions`,messageReaction:(t,e,n,i)=>`${o.messageReactions(t,e)}/${n}`+`${i?`?limit=${i}`:""}`,selfMessageReaction:(t,e,n,i)=>`${o.messageReaction(t,e,n,i)}/@me`,userMessageReaction:(t,e,n,i,s)=>`${o.messageReaction(t,e,n,i)}/${s}`,webhook:(t,e)=>`${r}/webhooks/${t}${e?`/${e}`:""}`,oauth2Application:t=>`${r}/oauth2/applications/${t}`,getApp:t=>`${r}/oauth2/authorize?client_id=${t}`,emoji:t=>`${o.CDN}/emojis/${t}.png`};e.Status={READY:0,CONNECTING:1,RECONNECTING:2,IDLE:3,NEARLY:4,DISCONNECTED:5},e.VoiceStatus={CONNECTED:0,CONNECTING:1,AUTHENTICATING:2,RECONNECTING:3,DISCONNECTED:4},e.ChannelTypes={TEXT:0,DM:1,VOICE:2,GROUP_DM:3},e.OPCodes={DISPATCH:0,HEARTBEAT:1,IDENTIFY:2,STATUS_UPDATE:3,VOICE_STATE_UPDATE:4,VOICE_GUILD_PING:5,RESUME:6,RECONNECT:7,REQUEST_GUILD_MEMBERS:8,INVALID_SESSION:9,HELLO:10,HEARTBEAT_ACK:11},e.VoiceOPCodes={IDENTIFY:0,SELECT_PROTOCOL:1,READY:2,HEARTBEAT:3,SESSION_DESCRIPTION:4,SPEAKING:5},e.Events={READY:"ready",GUILD_CREATE:"guildCreate",GUILD_DELETE:"guildDelete",GUILD_UPDATE:"guildUpdate",GUILD_UNAVAILABLE:"guildUnavailable",GUILD_AVAILABLE:"guildAvailable",GUILD_MEMBER_ADD:"guildMemberAdd",GUILD_MEMBER_REMOVE:"guildMemberRemove",GUILD_MEMBER_UPDATE:"guildMemberUpdate",GUILD_MEMBER_AVAILABLE:"guildMemberAvailable",GUILD_MEMBER_SPEAKING:"guildMemberSpeaking",GUILD_MEMBERS_CHUNK:"guildMembersChunk",GUILD_ROLE_CREATE:"roleCreate",GUILD_ROLE_DELETE:"roleDelete",GUILD_ROLE_UPDATE:"roleUpdate",GUILD_EMOJI_CREATE:"emojiCreate",GUILD_EMOJI_DELETE:"emojiDelete",GUILD_EMOJI_UPDATE:"emojiUpdate",GUILD_BAN_ADD:"guildBanAdd",GUILD_BAN_REMOVE:"guildBanRemove",CHANNEL_CREATE:"channelCreate",CHANNEL_DELETE:"channelDelete",CHANNEL_UPDATE:"channelUpdate",CHANNEL_PINS_UPDATE:"channelPinsUpdate",MESSAGE_CREATE:"message",MESSAGE_DELETE:"messageDelete",MESSAGE_UPDATE:"messageUpdate",MESSAGE_BULK_DELETE:"messageDeleteBulk",MESSAGE_REACTION_ADD:"messageReactionAdd",MESSAGE_REACTION_REMOVE:"messageReactionRemove",MESSAGE_REACTION_REMOVE_ALL:"messageReactionRemoveAll",USER_UPDATE:"userUpdate",USER_NOTE_UPDATE:"userNoteUpdate",PRESENCE_UPDATE:"presenceUpdate",VOICE_STATE_UPDATE:"voiceStateUpdate",TYPING_START:"typingStart",TYPING_STOP:"typingStop",DISCONNECT:"disconnect",RECONNECTING:"reconnecting",ERROR:"error",WARN:"warn",DEBUG:"debug"},e.WSEvents={READY:"READY",GUILD_SYNC:"GUILD_SYNC",GUILD_CREATE:"GUILD_CREATE",GUILD_DELETE:"GUILD_DELETE",GUILD_UPDATE:"GUILD_UPDATE",GUILD_MEMBER_ADD:"GUILD_MEMBER_ADD",GUILD_MEMBER_REMOVE:"GUILD_MEMBER_REMOVE",GUILD_MEMBER_UPDATE:"GUILD_MEMBER_UPDATE",GUILD_MEMBERS_CHUNK:"GUILD_MEMBERS_CHUNK",GUILD_ROLE_CREATE:"GUILD_ROLE_CREATE",GUILD_ROLE_DELETE:"GUILD_ROLE_DELETE",GUILD_ROLE_UPDATE:"GUILD_ROLE_UPDATE",GUILD_BAN_ADD:"GUILD_BAN_ADD",GUILD_BAN_REMOVE:"GUILD_BAN_REMOVE",GUILD_EMOJIS_UPDATE:"GUILD_EMOJIS_UPDATE",CHANNEL_CREATE:"CHANNEL_CREATE",CHANNEL_DELETE:"CHANNEL_DELETE",CHANNEL_UPDATE:"CHANNEL_UPDATE",CHANNEL_PINS_UPDATE:"CHANNEL_PINS_UPDATE",MESSAGE_CREATE:"MESSAGE_CREATE",MESSAGE_DELETE:"MESSAGE_DELETE",MESSAGE_UPDATE:"MESSAGE_UPDATE",MESSAGE_DELETE_BULK:"MESSAGE_DELETE_BULK",MESSAGE_REACTION_ADD:"MESSAGE_REACTION_ADD",MESSAGE_REACTION_REMOVE:"MESSAGE_REACTION_REMOVE",MESSAGE_REACTION_REMOVE_ALL:"MESSAGE_REACTION_REMOVE_ALL",USER_UPDATE:"USER_UPDATE",USER_NOTE_UPDATE:"USER_NOTE_UPDATE",PRESENCE_UPDATE:"PRESENCE_UPDATE",VOICE_STATE_UPDATE:"VOICE_STATE_UPDATE",TYPING_START:"TYPING_START",VOICE_SERVER_UPDATE:"VOICE_SERVER_UPDATE",RELATIONSHIP_ADD:"RELATIONSHIP_ADD",RELATIONSHIP_REMOVE:"RELATIONSHIP_REMOVE"},e.MessageTypes={0:"DEFAULT",1:"RECIPIENT_ADD",2:"RECIPIENT_REMOVE",3:"CALL",4:"CHANNEL_NAME_CHANGE",5:"CHANNEL_ICON_CHANGE",6:"PINS_ADD"},e.DefaultAvatars={BLURPLE:"6debd47ed13483642cf09e832ed0bc1b",GREY:"322c936a8c8be1b803cd94861bdfa868",GREEN:"dd4dbc0016779df1378e7812eabaa04d",ORANGE:"0e291f67c9274a1abdddeb3fd919cbaa",RED:"1cbd08c76f8af6dddce02c5138971129"},e.Colors={DEFAULT:0,AQUA:1752220,GREEN:3066993,BLUE:3447003,PURPLE:10181046,GOLD:15844367,ORANGE:15105570,RED:15158332,GREY:9807270,NAVY:3426654,DARK_AQUA:1146986,DARK_GREEN:2067276,DARK_BLUE:2123412,DARK_PURPLE:7419530,DARK_GOLD:12745742,DARK_ORANGE:11027200,DARK_RED:10038562,DARK_GREY:9936031,DARKER_GREY:8359053,LIGHT_GREY:12370112,DARK_NAVY:2899536,BLURPLE:7506394,GREYPLE:10070709,DARK_BUT_NOT_BLACK:2895667,NOT_QUITE_BLACK:2303786}}).call(e,n(18))},function(t,e){class n{constructor(t){this.packetManager=t}handle(t){return t}}t.exports=n},function(t,e){class n{constructor(t){this.client=t}handle(t){return t}}t.exports=n},function(t,e){class n extends Map{constructor(t){super(t),Object.defineProperty(this,"_array",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"_keyArray",{value:null,writable:!0,configurable:!0})}set(t,e){return this._array=null,this._keyArray=null,super.set(t,e)}delete(t){return this._array=null,this._keyArray=null,super.delete(t)}array(){return this._array&&this._array.length===this.size||(this._array=Array.from(this.values())),this._array}keyArray(){return this._keyArray&&this._keyArray.length===this.size||(this._keyArray=Array.from(this.keys())),this._keyArray}first(){return this.values().next().value}firstKey(){return this.keys().next().value}last(){const t=this.array();return t[t.length-1]}lastKey(){const t=this.keyArray();return t[t.length-1]}random(){const t=this.array();return t[Math.floor(Math.random()*t.length)]}randomKey(){const t=this.keyArray();return t[Math.floor(Math.random()*t.length)]}findAll(t,e){if("string"!=typeof t)throw new TypeError("Key must be a string.");if("undefined"==typeof e)throw new Error("Value must be specified.");const n=[];for(const i of this.values())i[t]===e&&n.push(i);return n}find(t,e){if("string"==typeof t){if("undefined"==typeof e)throw new Error("Value must be specified.");for(const n of this.values())if(n[t]===e)return n;return null}if("function"==typeof t){for(const[e,n]of this)if(t(n,e,this))return n;return null}throw new Error("First argument must be a property string or a function.")}findKey(t,e){if("string"==typeof t){if("undefined"==typeof e)throw new Error("Value must be specified.");for(const[n,i]of this)if(i[t]===e)return n;return null}if("function"==typeof t){for(const[e,n]of this)if(t(n,e,this))return e;return null}throw new Error("First argument must be a property string or a function.")}exists(t,e){if("id"===t)throw new RangeError("Don't use .exists() with IDs. Instead, use .has(id).");return Boolean(this.find(t,e))}filter(t,e){e&&(t=t.bind(e));const i=new n;for(const[s,r]of this)t(r,s,this)&&i.set(s,r);return i}filterArray(t,e){e&&(t=t.bind(e));const n=[];for(const[i,s]of this)t(s,i,this)&&n.push(s);return n}map(t,e){e&&(t=t.bind(e));const n=new Array(this.size);let i=0;for(const[s,r]of this)n[i++]=t(r,s,this);return n}some(t,e){e&&(t=t.bind(e));for(const[n,i]of this)if(t(i,n,this))return!0;return!1}every(t,e){e&&(t=t.bind(e));for(const[n,i]of this)if(!t(i,n,this))return!1;return!0}reduce(t,e){let n;if("undefined"!=typeof e){n=e;for(const[i,s]of this)n=t(n,s,i,this)}else{let e=!0;for(const[i,s]of this)e?(n=s,e=!1):n=t(n,s,i,this)}return n}clone(){return new this.constructor(this)}concat(...t){const e=this.clone();for(const n of t)for(const[i,s]of n)e.set(i,s);return e}deleteAll(){const t=[];for(const e of this.values())e.delete&&t.push(e.delete());return t}equals(t){return!!t&&(this===t||this.size===t.size&&!this.find((e,n)=>{const i=t.get(n);return i!==e||void 0===i&&!t.has(n)}))}}t.exports=n},function(t,e,n){(function(e){const i=n(25),s=n(0).Endpoints.botGateway;class r{constructor(){throw new Error(`The ${this.constructor.name} class may not be instantiated.`)}static splitMessage(t,{maxLength=1950,char="\n",prepend="",append=""}={}){if(t.length<=maxLength)return t;const e=t.split(char);if(1===e.length)throw new Error("Message exceeds the max length and contains no split characters.");const n=[""];let i=0;for(let s=0;smaxLength&&(n[i]+=append,n.push(prepend),i++),n[i]+=(n[i].length>0&&n[i]!==prepend?char:"")+e[s];return n}static escapeMarkdown(t,e=false,n=false){return e?t.replace(/```/g,"`​``"):n?t.replace(/\\(`|\\)/g,"$1").replace(/(`|\\)/g,"\\$1"):t.replace(/\\(\*|_|`|~|\\)/g,"$1").replace(/(\*|_|`|~|\\)/g,"\\$1")}static fetchRecommendedShards(t,e=1e3){return new Promise((n,r)=>{if(!t)throw new Error("A token must be provided.");i.get(s).set("Authorization",`Bot ${t.replace(/^Bot\s*/i,"")}`).end((t,i)=>{t&&r(t),n(i.body.shards*(1e3/e))})})}static parseEmoji(t){if(t.includes("%")&&(t=decodeURIComponent(t)),t.includes(":")){const[e,n]=t.split(":");return{name:e,id:n}}return{name:t,id:null}}static arraysEqual(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(const n in t){const i=t[n],s=e.indexOf(i);s&&e.splice(s,1)}return 0===e.length}static cloneObject(t){return Object.assign(Object.create(t),t)}static mergeDefault(t,e){if(!e)return t;for(const n in t)({}).hasOwnProperty.call(e,n)?e[n]===Object(e[n])&&(e[n]=this.mergeDefault(t[n],e[n])):e[n]=t[n];return e}static convertToBuffer(t){return"string"==typeof t&&(t=this.str2ab(t)),e.from(t)}static str2ab(t){const e=new ArrayBuffer(2*t.length),n=new Uint16Array(e);for(var i=0,s=t.length;i-1&&n=e?String(t):(String(n).repeat(e)+t).slice(-e)}const s=n(42),r=14200704e5;let o=0;class u{static generate(){o>=4095&&(o=0);const t=`${i((Date.now()-r).toString(2),42)}0000100000${i((o++).toString(2),12)}`;return s.fromString(t,2).toString()}static deconstruct(t){const e=i(s.fromString(t).toString(2),64),n={timestamp:parseInt(e.substring(0,42),2)+r,workerID:parseInt(e.substring(42,47),2),processID:parseInt(e.substring(47,52),2),increment:parseInt(e.substring(52,64),2),binary:e};return Object.defineProperty(n,"date",{get:function(){return new Date(this.timestamp)},enumerable:!0}),n}}t.exports=u},function(t,e,n){const i=n(0);class s{constructor(t,e){e="object"!=typeof t||t instanceof Array?t:e,this.member="object"==typeof t?t:null,this.bitfield="number"==typeof e?e:this.constructor.resolve(e)}get raw(){return this.bitfield}set raw(t){this.bitfield=t}has(t,e=true){return t instanceof Array?t.every(t=>this.has(t,e)):(t=this.constructor.resolve(t),!!(e&&(this.bitfield&this.constructor.FLAGS.ADMINISTRATOR)>0)||(this.bitfield&t)===t)}missing(t,e=true){return t.filter(t=>!this.has(t,e))}add(...t){let e=0;for(let n=0;nthis.resolve(t)).reduce((t,e)=>t|e,0);if("string"==typeof t&&(t=this.FLAGS[t]),"number"!=typeof t||t<1)throw new RangeError(i.Errors.NOT_A_PERMISSION);return t}}s.FLAGS={CREATE_INSTANT_INVITE:1,KICK_MEMBERS:2,BAN_MEMBERS:4,ADMINISTRATOR:8,MANAGE_CHANNELS:16,MANAGE_GUILD:32,ADD_REACTIONS:64,READ_MESSAGES:1024,SEND_MESSAGES:2048,SEND_TTS_MESSAGES:4096,MANAGE_MESSAGES:8192,EMBED_LINKS:16384,ATTACH_FILES:32768,READ_MESSAGE_HISTORY:65536,MENTION_EVERYONE:1<<17,EXTERNAL_EMOJIS:1<<18,USE_EXTERNAL_EMOJIS:1<<18,CONNECT:1<<20,SPEAK:1<<21,MUTE_MEMBERS:1<<22,DEAFEN_MEMBERS:1<<23,MOVE_MEMBERS:1<<24,USE_VAD:1<<25,CHANGE_NICKNAME:1<<26,MANAGE_NICKNAMES:1<<27,MANAGE_ROLES:1<<28,MANAGE_ROLES_OR_PERMISSIONS:1<<28,MANAGE_WEBHOOKS:1<<29,MANAGE_EMOJIS:1<<30},s.ALL=Object.keys(s.FLAGS).reduce((t,e)=>t|s.FLAGS[e],0),s.DEFAULT=104324097,t.exports=s},function(t,e){class n{constructor(t={}){this.status=t.status||"offline",this.game=t.game?new i(t.game):null}update(t){this.status=t.status||this.status,this.game=t.game?new i(t.game):null}equals(t){return this===t||(t&&this.status===t.status&&this.game?this.game.equals(t.game):!t.game)}}class i{constructor(t){this.name=t.name,this.type=t.type,this.url=t.url||null}get streaming(){return 1===this.type}equals(t){return this===t||t&&this.name===t.name&&this.type===t.type&&this.url===t.url}}e.Presence=n,e.Game=i},function(t,e,n){const i=n(5);class s{constructor(t,e){Object.defineProperty(this,"client",{value:t}),this.type=null,e&&this.setup(e)}setup(t){this.id=t.id}get createdTimestamp(){return i.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}delete(){return this.client.rest.methods.deleteChannel(this)}}t.exports=s},function(t,e,n){const i=n(5),s=n(6);class r{constructor(t,e){Object.defineProperty(this,"client",{value:t.client}),this.guild=t,e&&this.setup(e)}setup(t){this.id=t.id,this.name=t.name,this.color=t.color,this.hoist=t.hoist,this.position=t.position,this.permissions=t.permissions,this.managed=t.managed,this.mentionable=t.mentionable}get createdTimestamp(){return i.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get hexColor(){let t=this.color.toString(16);for(;t.length<6;)t=`0${t}`;return`#${t}`}get members(){return this.guild.members.filter(t=>t.roles.has(this.id))}get editable(){if(this.managed)return!1;const t=this.guild.member(this.client.user);return!!t.hasPermission(s.FLAGS.MANAGE_ROLES_OR_PERMISSIONS)&&t.highestRole.comparePositionTo(this)>0}get calculatedPosition(){const t=this.guild.roles.array().sort((t,e)=>t.position!==e.position?t.position-e.position:t.id-e.id);return t.indexOf(t.find(t=>t.id===this.id))}serialize(){return new s(this.permissions).serialize()}hasPermission(t,e=false,n){return new s(this.permissions).has(t,"undefined"!=typeof n?n:!e)}hasPermissions(t,e=false){return new s(this.permissions).has(t,!e)}comparePositionTo(t){return this.constructor.comparePositions(this,t)}edit(t){return this.client.rest.methods.updateGuildRole(this,t)}setName(t){return this.edit({name:t})}setColor(t){return this.edit({color:t})}setHoist(t){return this.edit({hoist:t})}setPosition(t,e){return this.guild.setRolePosition(this,t,e).then(()=>this)}setPermissions(t){return this.edit({permissions:t})}setMentionable(t){return this.edit({mentionable:t})}delete(){return this.client.rest.methods.deleteGuildRole(this)}equals(t){return t&&this.id===t.id&&this.name===t.name&&this.color===t.color&&this.hoist===t.hoist&&this.position===t.position&&this.permissions===t.permissions&&this.managed===t.managed}toString(){return this.id===this.guild.id?"@everyone":`<@&${this.id}>`}static comparePositions(t,e){return t.position===e.position?e.id-t.id:t.position-e.position}}t.exports=r},function(t,e,n){const i=n(14),s=n(0),r=n(7).Presence,o=n(5);class u{constructor(t,e){Object.defineProperty(this,"client",{value:t}),e&&this.setup(e)}setup(t){this.id=t.id,this.username=t.username,this.discriminator=t.discriminator,this.avatar=t.avatar,this.bot=Boolean(t.bot),this.lastMessageID=null,this.lastMessage=null}patch(t){for(const e of["id","username","discriminator","avatar","bot"])"undefined"!=typeof t[e]&&(this[e]=t[e]);t.token&&(this.client.token=t.token)}get createdTimestamp(){return o.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get presence(){if(this.client.presences.has(this.id))return this.client.presences.get(this.id);for(const t of this.client.guilds.values())if(t.presences.has(this.id))return t.presences.get(this.id);return new r}get avatarURL(){return this.avatar?s.Endpoints.avatar(this.id,this.avatar):null}get defaultAvatarURL(){const t=Object.keys(s.DefaultAvatars),e=t[this.discriminator%t.length];return s.Endpoints.assets(`${s.DefaultAvatars[e]}.png`)}get displayAvatarURL(){return this.avatarURL||this.defaultAvatarURL}get note(){return this.client.user.notes.get(this.id)||null}typingIn(t){return t=this.client.resolver.resolveChannel(t),t._typing.has(this.id)}typingSinceIn(t){return t=this.client.resolver.resolveChannel(t),t._typing.has(this.id)?new Date(t._typing.get(this.id).since):null}typingDurationIn(t){return t=this.client.resolver.resolveChannel(t),t._typing.has(this.id)?t._typing.get(this.id).elapsedTime:-1}get dmChannel(){return this.client.channels.filter(t=>"dm"===t.type).find(t=>t.recipient.id===this.id)}createDM(){return this.client.rest.methods.createDM(this)}deleteDM(){return this.client.rest.methods.deleteChannel(this)}addFriend(){return this.client.rest.methods.addFriend(this)}removeFriend(){return this.client.rest.methods.removeFriend(this)}block(){return this.client.rest.methods.blockUser(this)}unblock(){return this.client.rest.methods.unblockUser(this)}fetchProfile(){return this.client.rest.methods.fetchUserProfile(this)}setNote(t){return this.client.rest.methods.setNote(this,t)}equals(t){let e=t&&this.id===t.id&&this.username===t.username&&this.discriminator===t.discriminator&&this.avatar===t.avatar&&this.bot===Boolean(t.bot);return e}toString(){return`<@${this.id}>`}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendCode(){}}i.applyToClass(u),t.exports=u},function(t,e,n){const i=n(0),s=n(3),r=n(5);class o{constructor(t,e){Object.defineProperty(this,"client",{value:t.client}),this.guild=t,this.setup(e)}setup(t){this.id=t.id,this.name=t.name,this.requiresColons=t.require_colons,this.managed=t.managed,this._roles=t.roles}get createdTimestamp(){return r.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get roles(){const t=new s;for(const e of this._roles)this.guild.roles.has(e)&&t.set(e,this.guild.roles.get(e));return t}get url(){return i.Endpoints.emoji(this.id)}get identifier(){return this.id?`${this.name}:${this.id}`:encodeURIComponent(this.name)}edit(t){return this.client.rest.methods.updateEmoji(this,t)}toString(){return this.requiresColons?`<:${this.name}:${this.id}>`:this.name}equals(t){return t instanceof o?t.id===this.id&&t.name===this.name&&t.managed===this.managed&&t.requiresColons===this.requiresColons:t.id===this.id&&t.name===this.name}}t.exports=o},function(t,e,n){const i=n(14),s=n(9),r=n(6),o=n(3),u=n(7).Presence;class c{constructor(t,e){Object.defineProperty(this,"client",{value:t.client}),this.guild=t,this.user={},this._roles=[],e&&this.setup(e),this.lastMessageID=null,this.lastMessage=null}setup(t){this.serverDeaf=t.deaf,this.serverMute=t.mute,this.selfMute=t.self_mute,this.selfDeaf=t.self_deaf,this.voiceSessionID=t.session_id,this.voiceChannelID=t.channel_id,this.speaking=!1,this.nickname=t.nick||null,this.joinedTimestamp=new Date(t.joined_at).getTime(),this.user=t.user,this._roles=t.roles}get joinedAt(){return new Date(this.joinedTimestamp)}get presence(){return this.frozenPresence||this.guild.presences.get(this.id)||new u}get roles(){const t=new o,e=this.guild.roles.get(this.guild.id);e&&t.set(e.id,e);for(const n of this._roles){const e=this.guild.roles.get(n);e&&t.set(e.id,e)}return t}get highestRole(){return this.roles.reduce((t,e)=>!t||e.comparePositionTo(t)>0?e:t)}get colorRole(){const t=this.roles.filter(t=>t.color);return t.size?t.reduce((t,e)=>!t||e.comparePositionTo(t)>0?e:t):null}get displayColor(){const t=this.colorRole;return t&&t.color||0}get displayHexColor(){const t=this.colorRole;return t&&t.hexColor||"#000000"}get hoistRole(){const t=this.roles.filter(t=>t.hoist);return t.size?t.reduce((t,e)=>!t||e.comparePositionTo(t)>0?e:t):null}get mute(){return this.selfMute||this.serverMute}get deaf(){return this.selfDeaf||this.serverDeaf}get voiceChannel(){return this.guild.channels.get(this.voiceChannelID)}get id(){return this.user.id}get displayName(){return this.nickname||this.user.username}get permissions(){if(this.user.id===this.guild.ownerID)return new r(this,r.ALL);let t=0;const e=this.roles;for(const n of e.values())t|=n.permissions;return new r(this,t)}get kickable(){if(this.user.id===this.guild.ownerID)return!1;if(this.user.id===this.client.user.id)return!1;const t=this.guild.member(this.client.user);return!!t.hasPermission(r.FLAGS.KICK_MEMBERS)&&t.highestRole.comparePositionTo(this.highestRole)>0}get bannable(){if(this.user.id===this.guild.ownerID)return!1;if(this.user.id===this.client.user.id)return!1;const t=this.guild.member(this.client.user);return!!t.hasPermission(r.FLAGS.BAN_MEMBERS)&&t.highestRole.comparePositionTo(this.highestRole)>0}permissionsIn(t){if(t=this.client.resolver.resolveChannel(t),!t||!t.guild)throw new Error("Could not resolve channel to a guild channel.");return t.permissionsFor(this)}hasPermission(t,e=false,n,i){return"undefined"==typeof n&&(n=!e),"undefined"==typeof i&&(i=!e),!(!i||this.user.id!==this.guild.ownerID)||this.roles.some(e=>e.hasPermission(t,void 0,n))}hasPermissions(t,e=false){return!e&&this.user.id===this.guild.ownerID||t.every(t=>this.hasPermission(t,e))}missingPermissions(t,e=false){return t.filter(t=>!this.hasPermission(t,e))}edit(t){return this.client.rest.methods.updateGuildMember(this,t)}setMute(t){return this.edit({mute:t})}setDeaf(t){return this.edit({deaf:t})}setVoiceChannel(t){return this.edit({channel:t})}setRoles(t){return this.edit({roles:t})}addRole(t){return t instanceof s||(t=this.guild.roles.get(t)),this.client.rest.methods.addMemberRole(this,t)}addRoles(t){let e;if(t instanceof o){e=this._roles.slice();for(const n of t.values())e.push(n.id)}else e=this._roles.concat(t);return this.edit({roles:e})}removeRole(t){return t instanceof s||(t=this.guild.roles.get(t)),this.client.rest.methods.removeMemberRole(this,t)}removeRoles(t){const e=this._roles.slice();if(t instanceof o)for(const n of t.values()){const t=e.indexOf(n.id);t>=0&&e.splice(t,1)}else for(const n of t){const t=e.indexOf(n instanceof s?n.id:n);t>=0&&e.splice(t,1)}return this.edit({roles:e})}setNickname(t){return this.edit({nick:t})}createDM(){return this.user.createDM()}deleteDM(){return this.user.deleteDM()}kick(){return this.client.rest.methods.kickGuildMember(this.guild,this)}ban(t=0){return this.client.rest.methods.banGuildMember(this.guild,this,t)}toString(){return`<@${this.nickname?"!":""}${this.user.id}>`}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendCode(){}}i.applyToClass(c),t.exports=c},function(t,e,n){const i=n(32),s=n(34),r=n(35),o=n(4),u=n(3),c=n(0),h=n(6);let a;class l{constructor(t,e,n){Object.defineProperty(this,"client",{value:n}),this.channel=t,e&&this.setup(e)}setup(t){this.id=t.id,this.type=c.MessageTypes[t.type],this.content=t.content,this.author=this.client.dataManager.newUser(t.author),this.member=this.guild?this.guild.member(this.author)||null:null,this.pinned=t.pinned,this.tts=t.tts,this.nonce=t.nonce,this.system=6===t.type,this.embeds=t.embeds.map(t=>new s(this,t)),this.attachments=new u;for(const e of t.attachments)this.attachments.set(e.id,new i(this,e));this.createdTimestamp=new Date(t.timestamp).getTime(),this.editedTimestamp=t.edited_timestamp?new Date(t.edited_timestamp).getTime():null,this.mentions={users:new u,roles:new u,channels:new u,everyone:t.mention_everyone};for(const n of t.mentions){let t=this.client.users.get(n.id);t||(t=this.client.dataManager.newUser(n)),this.mentions.users.set(t.id,t)}if(Object.defineProperty(this.mentions,"members",{get:()=>{if("text"!==this.channel.type)return null;const t=new u;return this.mentions.users.forEach(e=>{const n=this.client.resolver.resolveGuildMember(this.channel.guild,e);n&&t.set(n.id,n)}),t}}),t.mention_roles)for(const n of t.mention_roles){const t=this.channel.guild.roles.get(n);t&&this.mentions.roles.set(t.id,t)}if("text"===this.channel.type){const e=t.content.match(/<#([0-9]{14,20})>/g)||[];for(const n of e){const t=this.channel.guild.channels.get(n.match(/([0-9]{14,20})/g)[0]);t&&this.mentions.channels.set(t.id,t)}}if(this._edits=[],this.reactions=new u,t.reactions&&t.reactions.length>0)for(const o of t.reactions){const t=o.emoji.id?`${o.emoji.name}:${o.emoji.id}`:o.emoji.name;this.reactions.set(t,new r(this,o.emoji,o.count,o.me))}this.webhookID=t.webhook_id||null,this.hit="boolean"==typeof t.hit?t.hit:null}patch(t){if(t.author&&(this.author=this.client.users.get(t.author.id),this.guild&&(this.member=this.guild.member(this.author))),t.content&&(this.content=t.content),t.timestamp&&(this.createdTimestamp=new Date(t.timestamp).getTime()),t.edited_timestamp&&(this.editedTimestamp=t.edited_timestamp?new Date(t.edited_timestamp).getTime():null),"tts"in t&&(this.tts=t.tts),"mention_everyone"in t&&(this.mentions.everyone=t.mention_everyone),t.nonce&&(this.nonce=t.nonce),t.embeds&&(this.embeds=t.embeds.map(t=>new s(this,t))),t.type>-1&&(this.system=!1,6===t.type&&(this.system=!0)),t.attachments){this.attachments.clear();for(const e of t.attachments)this.attachments.set(e.id,new i(this,e))}if(t.mentions){this.mentions.users.clear();for(const e of t.mentions){let t=this.client.users.get(e.id);t?this.mentions.users.set(t.id,t):(t=this.client.dataManager.newUser(e),this.mentions.users.set(t.id,t))}}if(t.mention_roles){this.mentions.roles.clear();for(const e of t.mention_roles){const t=this.channel.guild.roles.get(e);t&&this.mentions.roles.set(t.id,t)}}if(t.id&&(this.id=t.id),this.channel.guild&&t.content){this.mentions.channels.clear();const e=t.content.match(/<#([0-9]{14,20})>/g)||[];for(const n of e){const t=this.channel.guild.channels.get(n.match(/([0-9]{14,20})/g)[0]);t&&this.mentions.channels.set(t.id,t)}}if(t.reactions&&(this.reactions.clear(),t.reactions.length>0))for(const e of t.reactions){const t=e.emoji.id?`${e.emoji.name}:${e.emoji.id}`:e.emoji.name;this.reactions.set(t,new r(this,e.emoji,e.count,e.me))}}get createdAt(){return new Date(this.createdTimestamp)}get editedAt(){return this.editedTimestamp?new Date(this.editedTimestamp):null}get guild(){return this.channel.guild||null}get cleanContent(){return this.content.replace(/@(everyone|here)/g,"@​$1").replace(/<@!?[0-9]+>/g,t=>{const e=t.replace(/<|!|>|@/g,"");if("dm"===this.channel.type||"group"===this.channel.type)return this.client.users.has(e)?`@${this.client.users.get(e).username}`:t;const n=this.channel.guild.members.get(e);if(n)return n.nickname?`@${n.nickname}`:`@${n.user.username}`;{const n=this.client.users.get(e);return n?`@${n.username}`:t}}).replace(/<#[0-9]+>/g,t=>{const e=this.client.channels.get(t.replace(/<|#|>/g,""));return e?`#${e.name}`:t}).replace(/<@&[0-9]+>/g,t=>{if("dm"===this.channel.type||"group"===this.channel.type)return t;const e=this.guild.roles.get(t.replace(/<|@|>|&/g,""));return e?`@${e.name}`:t})}get edits(){const t=this._edits.slice();return t.unshift(this),t}get editable(){return this.author.id===this.client.user.id}get deletable(){return this.author.id===this.client.user.id||this.guild&&this.channel.permissionsFor(this.client.user).hasPermission(h.FLAGS.MANAGE_MESSAGES)}get pinnable(){return!this.guild||this.channel.permissionsFor(this.client.user).hasPermission(h.FLAGS.MANAGE_MESSAGES)}isMentioned(t){return t=t&&t.id?t.id:t,this.mentions.users.has(t)||this.mentions.channels.has(t)||this.mentions.roles.has(t)}isMemberMentioned(t){return a||(a=n(12)),!!this.mentions.everyone||(!!this.mentions.users.has(t.id)||!!(t instanceof a&&t.roles.some(t=>this.mentions.roles.has(t.id))))}edit(t,e){return e||"object"!=typeof t||t instanceof Array?e||(e={}):(e=t,t=""),this.client.rest.methods.updateMessage(this,t,e)}editCode(t,e){return e=o.escapeMarkdown(this.client.resolver.resolveString(e),!0),this.edit(`\`\`\`${t||""} +!function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=145)}([function(t,e,n){(function(t){e.Package=n(28),e.DefaultOptions={apiRequestMethod:"sequential",shardId:0,shardCount:0,messageCacheMaxSize:200,messageCacheLifetime:0,messageSweepInterval:0,fetchAllMembers:!1,disableEveryone:!1,sync:!1,restWsBridgeTimeout:5e3,disabledEvents:[],restTimeOffset:500,ws:{large_threshold:250,compress:"browser"!==n(15).platform(),properties:{$os:t?t.platform:"discord.js",$browser:"discord.js",$device:"discord.js",$referrer:"",$referring_domain:""}}},e.Errors={NO_TOKEN:"Request to use token, but token was unavailable to the client.",NO_BOT_ACCOUNT:"Only bot accounts are able to make use of this feature.",NO_USER_ACCOUNT:"Only user accounts are able to make use of this feature.",BAD_WS_MESSAGE:"A bad message was received from the websocket; either bad compression, or not JSON.",TOOK_TOO_LONG:"Something took too long to do.",NOT_A_PERMISSION:"Invalid permission string or number.",INVALID_RATE_LIMIT_METHOD:"Unknown rate limiting method.",BAD_LOGIN:"Incorrect login details were provided.",INVALID_SHARD:"Invalid shard settings were provided.",SHARDING_REQUIRED:"This session would have handled too many guilds - Sharding is required.",INVALID_TOKEN:"An invalid token was provided."};const i=e.PROTOCOL_VERSION=6,s=e.HOST=`https://discordapp.com`,r=e.API=`${s}/api/v${i}`,o=e.Endpoints={login:`${r}/auth/login`,logout:`${r}/auth/logout`,gateway:`${r}/gateway`,botGateway:`${r}/gateway/bot`,invite:t=>`${r}/invite/${t}`,inviteLink:t=>`https://discord.gg/${t}`,assets:t=>`${s}/assets/${t}`,CDN:"https://cdn.discordapp.com",user:t=>`${r}/users/${t}`,userChannels:t=>`${o.user(t)}/channels`,userProfile:t=>`${o.user(t)}/profile`,avatar:(t,e)=>{return"1"===t?e:`${o.CDN}/avatars/${t}/${e}.${e.startsWith("a_")?"gif":"jpg"}?size=1024`},me:`${r}/users/@me`,meGuild:t=>`${o.me}/guilds/${t}`,meChannels:`${r}/users/@me/channels`,meMentions:(t,e,n,i)=>`users/@me/mentions?limit=${t}&roles=${e}&everyone=${n}${i?`&guild_id=${i}`:""}`,relationships:t=>`${o.user(t)}/relationships`,note:t=>`${o.me}/notes/${t}`,voiceRegions:`${r}/voice/regions`,guilds:`${r}/guilds`,guild:t=>`${o.guilds}/${t}`,guildIcon:(t,e)=>`${o.CDN}/icons/${t}/${e}.jpg`,guildSplash:(t,e)=>`${o.CDN}/splashes/${t}/${e}.jpg`,guildPrune:t=>`${o.guild(t)}/prune`,guildEmbed:t=>`${o.guild(t)}/embed`,guildInvites:t=>`${o.guild(t)}/invites`,guildRoles:t=>`${o.guild(t)}/roles`,guildRole:(t,e)=>`${o.guildRoles(t)}/${e}`,guildBans:t=>`${o.guild(t)}/bans`,guildIntegrations:t=>`${o.guild(t)}/integrations`,guildMembers:t=>`${o.guild(t)}/members`,guildMember:(t,e)=>`${o.guildMembers(t)}/${e}`,guildMemberRole:(t,e,n)=>`${o.guildMember(t,e)}/roles/${n}`,guildMemberNickname:t=>`${o.guildMember(t,"@me")}/nick`,guildChannels:t=>`${o.guild(t)}/channels`,guildEmojis:t=>`${o.guild(t)}/emojis`,guildEmoji:(t,e)=>`${o.guildEmojis(t)}/${e}`,guildSearch:t=>`${o.guild(t)}/messages/search`,guildVoiceRegions:t=>`${o.guild(t)}/regions`,guildWebhooks:t=>`${o.guild(t)}/webhooks`,channels:`${r}/channels`,channel:t=>`${o.channels}/${t}`,channelMessages:t=>`${o.channel(t)}/messages`,channelInvites:t=>`${o.channel(t)}/invites`,channelTyping:t=>`${o.channel(t)}/typing`,channelPermissions:t=>`${o.channel(t)}/permissions`,channelMessage:(t,e)=>`${o.channelMessages(t)}/${e}`,channelWebhooks:t=>`${o.channel(t)}/webhooks`,channelSearch:t=>`${o.channelMessages(t)}/search`,dmChannelRecipient:(t,e)=>`${o.channel(t)}/recipients/${e}`,messageReactions:(t,e)=>`${o.channelMessage(t,e)}/reactions`,messageReaction:(t,e,n,i)=>`${o.messageReactions(t,e)}/${n}`+`${i?`?limit=${i}`:""}`,selfMessageReaction:(t,e,n,i)=>`${o.messageReaction(t,e,n,i)}/@me`,userMessageReaction:(t,e,n,i,s)=>`${o.messageReaction(t,e,n,i)}/${s}`,webhook:(t,e)=>`${r}/webhooks/${t}${e?`/${e}`:""}`,oauth2Application:t=>`${r}/oauth2/applications/${t}`,getApp:t=>`${r}/oauth2/authorize?client_id=${t}`,emoji:t=>`${o.CDN}/emojis/${t}.png`};e.Status={READY:0,CONNECTING:1,RECONNECTING:2,IDLE:3,NEARLY:4,DISCONNECTED:5},e.VoiceStatus={CONNECTED:0,CONNECTING:1,AUTHENTICATING:2,RECONNECTING:3,DISCONNECTED:4},e.ChannelTypes={TEXT:0,DM:1,VOICE:2,GROUP_DM:3},e.OPCodes={DISPATCH:0,HEARTBEAT:1,IDENTIFY:2,STATUS_UPDATE:3,VOICE_STATE_UPDATE:4,VOICE_GUILD_PING:5,RESUME:6,RECONNECT:7,REQUEST_GUILD_MEMBERS:8,INVALID_SESSION:9,HELLO:10,HEARTBEAT_ACK:11},e.VoiceOPCodes={IDENTIFY:0,SELECT_PROTOCOL:1,READY:2,HEARTBEAT:3,SESSION_DESCRIPTION:4,SPEAKING:5},e.Events={READY:"ready",GUILD_CREATE:"guildCreate",GUILD_DELETE:"guildDelete",GUILD_UPDATE:"guildUpdate",GUILD_UNAVAILABLE:"guildUnavailable",GUILD_AVAILABLE:"guildAvailable",GUILD_MEMBER_ADD:"guildMemberAdd",GUILD_MEMBER_REMOVE:"guildMemberRemove",GUILD_MEMBER_UPDATE:"guildMemberUpdate",GUILD_MEMBER_AVAILABLE:"guildMemberAvailable",GUILD_MEMBER_SPEAKING:"guildMemberSpeaking",GUILD_MEMBERS_CHUNK:"guildMembersChunk",GUILD_ROLE_CREATE:"roleCreate",GUILD_ROLE_DELETE:"roleDelete",GUILD_ROLE_UPDATE:"roleUpdate",GUILD_EMOJI_CREATE:"emojiCreate",GUILD_EMOJI_DELETE:"emojiDelete",GUILD_EMOJI_UPDATE:"emojiUpdate",GUILD_BAN_ADD:"guildBanAdd",GUILD_BAN_REMOVE:"guildBanRemove",CHANNEL_CREATE:"channelCreate",CHANNEL_DELETE:"channelDelete",CHANNEL_UPDATE:"channelUpdate",CHANNEL_PINS_UPDATE:"channelPinsUpdate",MESSAGE_CREATE:"message",MESSAGE_DELETE:"messageDelete",MESSAGE_UPDATE:"messageUpdate",MESSAGE_BULK_DELETE:"messageDeleteBulk",MESSAGE_REACTION_ADD:"messageReactionAdd",MESSAGE_REACTION_REMOVE:"messageReactionRemove",MESSAGE_REACTION_REMOVE_ALL:"messageReactionRemoveAll",USER_UPDATE:"userUpdate",USER_NOTE_UPDATE:"userNoteUpdate",PRESENCE_UPDATE:"presenceUpdate",VOICE_STATE_UPDATE:"voiceStateUpdate",TYPING_START:"typingStart",TYPING_STOP:"typingStop",DISCONNECT:"disconnect",RECONNECTING:"reconnecting",ERROR:"error",WARN:"warn",DEBUG:"debug"},e.WSEvents={READY:"READY",GUILD_SYNC:"GUILD_SYNC",GUILD_CREATE:"GUILD_CREATE",GUILD_DELETE:"GUILD_DELETE",GUILD_UPDATE:"GUILD_UPDATE",GUILD_MEMBER_ADD:"GUILD_MEMBER_ADD",GUILD_MEMBER_REMOVE:"GUILD_MEMBER_REMOVE",GUILD_MEMBER_UPDATE:"GUILD_MEMBER_UPDATE",GUILD_MEMBERS_CHUNK:"GUILD_MEMBERS_CHUNK",GUILD_ROLE_CREATE:"GUILD_ROLE_CREATE",GUILD_ROLE_DELETE:"GUILD_ROLE_DELETE",GUILD_ROLE_UPDATE:"GUILD_ROLE_UPDATE",GUILD_BAN_ADD:"GUILD_BAN_ADD",GUILD_BAN_REMOVE:"GUILD_BAN_REMOVE",GUILD_EMOJIS_UPDATE:"GUILD_EMOJIS_UPDATE",CHANNEL_CREATE:"CHANNEL_CREATE",CHANNEL_DELETE:"CHANNEL_DELETE",CHANNEL_UPDATE:"CHANNEL_UPDATE",CHANNEL_PINS_UPDATE:"CHANNEL_PINS_UPDATE",MESSAGE_CREATE:"MESSAGE_CREATE",MESSAGE_DELETE:"MESSAGE_DELETE",MESSAGE_UPDATE:"MESSAGE_UPDATE",MESSAGE_DELETE_BULK:"MESSAGE_DELETE_BULK",MESSAGE_REACTION_ADD:"MESSAGE_REACTION_ADD",MESSAGE_REACTION_REMOVE:"MESSAGE_REACTION_REMOVE",MESSAGE_REACTION_REMOVE_ALL:"MESSAGE_REACTION_REMOVE_ALL",USER_UPDATE:"USER_UPDATE",USER_NOTE_UPDATE:"USER_NOTE_UPDATE",PRESENCE_UPDATE:"PRESENCE_UPDATE",VOICE_STATE_UPDATE:"VOICE_STATE_UPDATE",TYPING_START:"TYPING_START",VOICE_SERVER_UPDATE:"VOICE_SERVER_UPDATE",RELATIONSHIP_ADD:"RELATIONSHIP_ADD",RELATIONSHIP_REMOVE:"RELATIONSHIP_REMOVE"},e.MessageTypes={0:"DEFAULT",1:"RECIPIENT_ADD",2:"RECIPIENT_REMOVE",3:"CALL",4:"CHANNEL_NAME_CHANGE",5:"CHANNEL_ICON_CHANGE",6:"PINS_ADD"},e.DefaultAvatars={BLURPLE:"6debd47ed13483642cf09e832ed0bc1b",GREY:"322c936a8c8be1b803cd94861bdfa868",GREEN:"dd4dbc0016779df1378e7812eabaa04d",ORANGE:"0e291f67c9274a1abdddeb3fd919cbaa",RED:"1cbd08c76f8af6dddce02c5138971129"},e.Colors={DEFAULT:0,AQUA:1752220,GREEN:3066993,BLUE:3447003,PURPLE:10181046,GOLD:15844367,ORANGE:15105570,RED:15158332,GREY:9807270,NAVY:3426654,DARK_AQUA:1146986,DARK_GREEN:2067276,DARK_BLUE:2123412,DARK_PURPLE:7419530,DARK_GOLD:12745742,DARK_ORANGE:11027200,DARK_RED:10038562,DARK_GREY:9936031,DARKER_GREY:8359053,LIGHT_GREY:12370112,DARK_NAVY:2899536,BLURPLE:7506394,GREYPLE:10070709,DARK_BUT_NOT_BLACK:2895667,NOT_QUITE_BLACK:2303786}}).call(e,n(18))},function(t,e){class n{constructor(t){this.packetManager=t}handle(t){return t}}t.exports=n},function(t,e){class n{constructor(t){this.client=t}handle(t){return t}}t.exports=n},function(t,e){class n extends Map{constructor(t){super(t),Object.defineProperty(this,"_array",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"_keyArray",{value:null,writable:!0,configurable:!0})}set(t,e){return this._array=null,this._keyArray=null,super.set(t,e)}delete(t){return this._array=null,this._keyArray=null,super.delete(t)}array(){return this._array&&this._array.length===this.size||(this._array=Array.from(this.values())),this._array}keyArray(){return this._keyArray&&this._keyArray.length===this.size||(this._keyArray=Array.from(this.keys())),this._keyArray}first(){return this.values().next().value}firstKey(){return this.keys().next().value}last(){const t=this.array();return t[t.length-1]}lastKey(){const t=this.keyArray();return t[t.length-1]}random(){const t=this.array();return t[Math.floor(Math.random()*t.length)]}randomKey(){const t=this.keyArray();return t[Math.floor(Math.random()*t.length)]}findAll(t,e){if("string"!=typeof t)throw new TypeError("Key must be a string.");if("undefined"==typeof e)throw new Error("Value must be specified.");const n=[];for(const i of this.values())i[t]===e&&n.push(i);return n}find(t,e){if("string"==typeof t){if("undefined"==typeof e)throw new Error("Value must be specified.");for(const n of this.values())if(n[t]===e)return n;return null}if("function"==typeof t){for(const[e,n]of this)if(t(n,e,this))return n;return null}throw new Error("First argument must be a property string or a function.")}findKey(t,e){if("string"==typeof t){if("undefined"==typeof e)throw new Error("Value must be specified.");for(const[n,i]of this)if(i[t]===e)return n;return null}if("function"==typeof t){for(const[e,n]of this)if(t(n,e,this))return e;return null}throw new Error("First argument must be a property string or a function.")}exists(t,e){return Boolean(this.find(t,e))}filter(t,e){e&&(t=t.bind(e));const i=new n;for(const[s,r]of this)t(r,s,this)&&i.set(s,r);return i}filterArray(t,e){e&&(t=t.bind(e));const n=[];for(const[i,s]of this)t(s,i,this)&&n.push(s);return n}map(t,e){e&&(t=t.bind(e));const n=new Array(this.size);let i=0;for(const[s,r]of this)n[i++]=t(r,s,this);return n}some(t,e){e&&(t=t.bind(e));for(const[n,i]of this)if(t(i,n,this))return!0;return!1}every(t,e){e&&(t=t.bind(e));for(const[n,i]of this)if(!t(i,n,this))return!1;return!0}reduce(t,e){let n;if("undefined"!=typeof e){n=e;for(const[i,s]of this)n=t(n,s,i,this)}else{let e=!0;for(const[i,s]of this)e?(n=s,e=!1):n=t(n,s,i,this)}return n}clone(){return new this.constructor(this)}concat(...t){const e=this.clone();for(const n of t)for(const[i,s]of n)e.set(i,s);return e}deleteAll(){const t=[];for(const e of this.values())e.delete&&t.push(e.delete());return t}equals(t){return!!t&&(this===t||this.size===t.size&&!this.find((e,n)=>{const i=t.get(n);return i!==e||void 0===i&&!t.has(n)}))}}t.exports=n},function(t,e,n){(function(e){const i=n(25),s=n(0).Endpoints.botGateway;class r{constructor(){throw new Error(`The ${this.constructor.name} class may not be instantiated.`)}static splitMessage(t,{maxLength=1950,char="\n",prepend="",append=""}={}){if(t.length<=maxLength)return t;const e=t.split(char);if(1===e.length)throw new Error("Message exceeds the max length and contains no split characters.");const n=[""];let i=0;for(let s=0;smaxLength&&(n[i]+=append,n.push(prepend),i++),n[i]+=(n[i].length>0&&n[i]!==prepend?char:"")+e[s];return n}static escapeMarkdown(t,e=false,n=false){return e?t.replace(/```/g,"`​``"):n?t.replace(/\\(`|\\)/g,"$1").replace(/(`|\\)/g,"\\$1"):t.replace(/\\(\*|_|`|~|\\)/g,"$1").replace(/(\*|_|`|~|\\)/g,"\\$1")}static fetchRecommendedShards(t,e=1e3){return new Promise((n,r)=>{if(!t)throw new Error("A token must be provided.");i.get(s).set("Authorization",`Bot ${t.replace(/^Bot\s*/i,"")}`).end((t,i)=>{t&&r(t),n(i.body.shards*(1e3/e))})})}static parseEmoji(t){if(t.includes("%")&&(t=decodeURIComponent(t)),t.includes(":")){const[e,n]=t.split(":");return{name:e,id:n}}return{name:t,id:null}}static arraysEqual(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(const n in t){const i=t[n],s=e.indexOf(i);s&&e.splice(s,1)}return 0===e.length}static cloneObject(t){return Object.assign(Object.create(t),t)}static mergeDefault(t,e){if(!e)return t;for(const n in t)({}).hasOwnProperty.call(e,n)?e[n]===Object(e[n])&&(e[n]=this.mergeDefault(t[n],e[n])):e[n]=t[n];return e}static convertToBuffer(t){return"string"==typeof t&&(t=this.str2ab(t)),e.from(t)}static str2ab(t){const e=new ArrayBuffer(2*t.length),n=new Uint16Array(e);for(var i=0,s=t.length;i-1&&n=e?String(t):(String(n).repeat(e)+t).slice(-e)}const s=n(42),r=14200704e5;let o=0;class u{static generate(){o>=4095&&(o=0);const t=`${i((Date.now()-r).toString(2),42)}0000100000${i((o++).toString(2),12)}`;return s.fromString(t,2).toString()}static deconstruct(t){const e=i(s.fromString(t).toString(2),64),n={timestamp:parseInt(e.substring(0,42),2)+r,workerID:parseInt(e.substring(42,47),2),processID:parseInt(e.substring(47,52),2),increment:parseInt(e.substring(52,64),2),binary:e};return Object.defineProperty(n,"date",{get:function(){return new Date(this.timestamp)},enumerable:!0}),n}}t.exports=u},function(t,e,n){const i=n(0);class s{constructor(t,e){e="object"!=typeof t||t instanceof Array?t:e,this.member="object"==typeof t?t:null,this.bitfield="number"==typeof e?e:this.constructor.resolve(e)}get raw(){return this.bitfield}set raw(t){this.bitfield=t}has(t,e=true){return t instanceof Array?t.every(t=>this.has(t,e)):(t=this.constructor.resolve(t),!!(e&&(this.bitfield&this.constructor.FLAGS.ADMINISTRATOR)>0)||(this.bitfield&t)===t)}missing(t,e=true){return t.filter(t=>!this.has(t,e))}add(...t){let e=0;for(let n=0;nthis.resolve(t)).reduce((t,e)=>t|e,0);if("string"==typeof t&&(t=this.FLAGS[t]),"number"!=typeof t||t<1)throw new RangeError(i.Errors.NOT_A_PERMISSION);return t}}s.FLAGS={CREATE_INSTANT_INVITE:1,KICK_MEMBERS:2,BAN_MEMBERS:4,ADMINISTRATOR:8,MANAGE_CHANNELS:16,MANAGE_GUILD:32,ADD_REACTIONS:64,READ_MESSAGES:1024,SEND_MESSAGES:2048,SEND_TTS_MESSAGES:4096,MANAGE_MESSAGES:8192,EMBED_LINKS:16384,ATTACH_FILES:32768,READ_MESSAGE_HISTORY:65536,MENTION_EVERYONE:1<<17,EXTERNAL_EMOJIS:1<<18,USE_EXTERNAL_EMOJIS:1<<18,CONNECT:1<<20,SPEAK:1<<21,MUTE_MEMBERS:1<<22,DEAFEN_MEMBERS:1<<23,MOVE_MEMBERS:1<<24,USE_VAD:1<<25,CHANGE_NICKNAME:1<<26,MANAGE_NICKNAMES:1<<27,MANAGE_ROLES:1<<28,MANAGE_ROLES_OR_PERMISSIONS:1<<28,MANAGE_WEBHOOKS:1<<29,MANAGE_EMOJIS:1<<30},s.ALL=Object.keys(s.FLAGS).reduce((t,e)=>t|s.FLAGS[e],0),s.DEFAULT=104324097,t.exports=s},function(t,e){class n{constructor(t={}){this.status=t.status||"offline",this.game=t.game?new i(t.game):null}update(t){this.status=t.status||this.status,this.game=t.game?new i(t.game):null}equals(t){return this===t||(t&&this.status===t.status&&this.game?this.game.equals(t.game):!t.game)}}class i{constructor(t){this.name=t.name,this.type=t.type,this.url=t.url||null}get streaming(){return 1===this.type}equals(t){return this===t||t&&this.name===t.name&&this.type===t.type&&this.url===t.url}}e.Presence=n,e.Game=i},function(t,e,n){const i=n(5);class s{constructor(t,e){Object.defineProperty(this,"client",{value:t}),this.type=null,e&&this.setup(e)}setup(t){this.id=t.id}get createdTimestamp(){return i.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}delete(){return this.client.rest.methods.deleteChannel(this)}}t.exports=s},function(t,e,n){const i=n(5),s=n(6);class r{constructor(t,e){Object.defineProperty(this,"client",{value:t.client}),this.guild=t,e&&this.setup(e)}setup(t){this.id=t.id,this.name=t.name,this.color=t.color,this.hoist=t.hoist,this.position=t.position,this.permissions=t.permissions,this.managed=t.managed,this.mentionable=t.mentionable}get createdTimestamp(){return i.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get hexColor(){let t=this.color.toString(16);for(;t.length<6;)t=`0${t}`;return`#${t}`}get members(){return this.guild.members.filter(t=>t.roles.has(this.id))}get editable(){if(this.managed)return!1;const t=this.guild.member(this.client.user);return!!t.hasPermission(s.FLAGS.MANAGE_ROLES_OR_PERMISSIONS)&&t.highestRole.comparePositionTo(this)>0}get calculatedPosition(){const t=this.guild.roles.array().sort((t,e)=>t.position!==e.position?t.position-e.position:t.id-e.id);return t.indexOf(t.find(t=>t.id===this.id))}serialize(){return new s(this.permissions).serialize()}hasPermission(t,e=false,n){return new s(this.permissions).has(t,"undefined"!=typeof n?n:!e)}hasPermissions(t,e=false){return new s(this.permissions).has(t,!e)}comparePositionTo(t){return this.constructor.comparePositions(this,t)}edit(t){return this.client.rest.methods.updateGuildRole(this,t)}setName(t){return this.edit({name:t})}setColor(t){return this.edit({color:t})}setHoist(t){return this.edit({hoist:t})}setPosition(t,e){return this.guild.setRolePosition(this,t,e).then(()=>this)}setPermissions(t){return this.edit({permissions:t})}setMentionable(t){return this.edit({mentionable:t})}delete(){return this.client.rest.methods.deleteGuildRole(this)}equals(t){return t&&this.id===t.id&&this.name===t.name&&this.color===t.color&&this.hoist===t.hoist&&this.position===t.position&&this.permissions===t.permissions&&this.managed===t.managed}toString(){return this.id===this.guild.id?"@everyone":`<@&${this.id}>`}static comparePositions(t,e){return t.position===e.position?e.id-t.id:t.position-e.position}}t.exports=r},function(t,e,n){const i=n(14),s=n(0),r=n(7).Presence,o=n(5);class u{constructor(t,e){Object.defineProperty(this,"client",{value:t}),e&&this.setup(e)}setup(t){this.id=t.id,this.username=t.username,this.discriminator=t.discriminator,this.avatar=t.avatar,this.bot=Boolean(t.bot),this.lastMessageID=null,this.lastMessage=null}patch(t){for(const e of["id","username","discriminator","avatar","bot"])"undefined"!=typeof t[e]&&(this[e]=t[e]);t.token&&(this.client.token=t.token)}get createdTimestamp(){return o.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get presence(){if(this.client.presences.has(this.id))return this.client.presences.get(this.id);for(const t of this.client.guilds.values())if(t.presences.has(this.id))return t.presences.get(this.id);return new r}get avatarURL(){return this.avatar?s.Endpoints.avatar(this.id,this.avatar):null}get defaultAvatarURL(){const t=Object.keys(s.DefaultAvatars),e=t[this.discriminator%t.length];return s.Endpoints.assets(`${s.DefaultAvatars[e]}.png`)}get displayAvatarURL(){return this.avatarURL||this.defaultAvatarURL}get note(){return this.client.user.notes.get(this.id)||null}typingIn(t){return t=this.client.resolver.resolveChannel(t),t._typing.has(this.id)}typingSinceIn(t){return t=this.client.resolver.resolveChannel(t),t._typing.has(this.id)?new Date(t._typing.get(this.id).since):null}typingDurationIn(t){return t=this.client.resolver.resolveChannel(t),t._typing.has(this.id)?t._typing.get(this.id).elapsedTime:-1}get dmChannel(){return this.client.channels.filter(t=>"dm"===t.type).find(t=>t.recipient.id===this.id)}createDM(){return this.client.rest.methods.createDM(this)}deleteDM(){return this.client.rest.methods.deleteChannel(this)}addFriend(){return this.client.rest.methods.addFriend(this)}removeFriend(){return this.client.rest.methods.removeFriend(this)}block(){return this.client.rest.methods.blockUser(this)}unblock(){return this.client.rest.methods.unblockUser(this)}fetchProfile(){return this.client.rest.methods.fetchUserProfile(this)}setNote(t){return this.client.rest.methods.setNote(this,t)}equals(t){let e=t&&this.id===t.id&&this.username===t.username&&this.discriminator===t.discriminator&&this.avatar===t.avatar&&this.bot===Boolean(t.bot);return e}toString(){return`<@${this.id}>`}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendCode(){}}i.applyToClass(u),t.exports=u},function(t,e,n){const i=n(0),s=n(3),r=n(5);class o{constructor(t,e){Object.defineProperty(this,"client",{value:t.client}),this.guild=t,this.setup(e)}setup(t){this.id=t.id,this.name=t.name,this.requiresColons=t.require_colons,this.managed=t.managed,this._roles=t.roles}get createdTimestamp(){return r.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get roles(){const t=new s;for(const e of this._roles)this.guild.roles.has(e)&&t.set(e,this.guild.roles.get(e));return t}get url(){return i.Endpoints.emoji(this.id)}get identifier(){return this.id?`${this.name}:${this.id}`:encodeURIComponent(this.name)}edit(t){return this.client.rest.methods.updateEmoji(this,t)}toString(){return this.requiresColons?`<:${this.name}:${this.id}>`:this.name}equals(t){return t instanceof o?t.id===this.id&&t.name===this.name&&t.managed===this.managed&&t.requiresColons===this.requiresColons:t.id===this.id&&t.name===this.name}}t.exports=o},function(t,e,n){const i=n(14),s=n(9),r=n(6),o=n(3),u=n(7).Presence;class c{constructor(t,e){Object.defineProperty(this,"client",{value:t.client}),this.guild=t,this.user={},this._roles=[],e&&this.setup(e),this.lastMessageID=null,this.lastMessage=null}setup(t){this.serverDeaf=t.deaf,this.serverMute=t.mute,this.selfMute=t.self_mute,this.selfDeaf=t.self_deaf,this.voiceSessionID=t.session_id,this.voiceChannelID=t.channel_id,this.speaking=!1,this.nickname=t.nick||null,this.joinedTimestamp=new Date(t.joined_at).getTime(),this.user=t.user,this._roles=t.roles}get joinedAt(){return new Date(this.joinedTimestamp)}get presence(){return this.frozenPresence||this.guild.presences.get(this.id)||new u}get roles(){const t=new o,e=this.guild.roles.get(this.guild.id);e&&t.set(e.id,e);for(const n of this._roles){const e=this.guild.roles.get(n);e&&t.set(e.id,e)}return t}get highestRole(){return this.roles.reduce((t,e)=>!t||e.comparePositionTo(t)>0?e:t)}get colorRole(){const t=this.roles.filter(t=>t.color);return t.size?t.reduce((t,e)=>!t||e.comparePositionTo(t)>0?e:t):null}get displayColor(){const t=this.colorRole;return t&&t.color||0}get displayHexColor(){const t=this.colorRole;return t&&t.hexColor||"#000000"}get hoistRole(){const t=this.roles.filter(t=>t.hoist);return t.size?t.reduce((t,e)=>!t||e.comparePositionTo(t)>0?e:t):null}get mute(){return this.selfMute||this.serverMute}get deaf(){return this.selfDeaf||this.serverDeaf}get voiceChannel(){return this.guild.channels.get(this.voiceChannelID)}get id(){return this.user.id}get displayName(){return this.nickname||this.user.username}get permissions(){if(this.user.id===this.guild.ownerID)return new r(this,r.ALL);let t=0;const e=this.roles;for(const n of e.values())t|=n.permissions;return new r(this,t)}get kickable(){if(this.user.id===this.guild.ownerID)return!1;if(this.user.id===this.client.user.id)return!1;const t=this.guild.member(this.client.user);return!!t.hasPermission(r.FLAGS.KICK_MEMBERS)&&t.highestRole.comparePositionTo(this.highestRole)>0}get bannable(){if(this.user.id===this.guild.ownerID)return!1;if(this.user.id===this.client.user.id)return!1;const t=this.guild.member(this.client.user);return!!t.hasPermission(r.FLAGS.BAN_MEMBERS)&&t.highestRole.comparePositionTo(this.highestRole)>0}permissionsIn(t){if(t=this.client.resolver.resolveChannel(t),!t||!t.guild)throw new Error("Could not resolve channel to a guild channel.");return t.permissionsFor(this)}hasPermission(t,e=false,n,i){return"undefined"==typeof n&&(n=!e),"undefined"==typeof i&&(i=!e),!(!i||this.user.id!==this.guild.ownerID)||this.roles.some(e=>e.hasPermission(t,void 0,n))}hasPermissions(t,e=false){return!e&&this.user.id===this.guild.ownerID||t.every(t=>this.hasPermission(t,e))}missingPermissions(t,e=false){return t.filter(t=>!this.hasPermission(t,e))}edit(t){return this.client.rest.methods.updateGuildMember(this,t)}setMute(t){return this.edit({mute:t})}setDeaf(t){return this.edit({deaf:t})}setVoiceChannel(t){return this.edit({channel:t})}setRoles(t){return this.edit({roles:t})}addRole(t){return t instanceof s||(t=this.guild.roles.get(t)),this.client.rest.methods.addMemberRole(this,t)}addRoles(t){let e;if(t instanceof o){e=this._roles.slice();for(const n of t.values())e.push(n.id)}else e=this._roles.concat(t);return this.edit({roles:e})}removeRole(t){return t instanceof s||(t=this.guild.roles.get(t)),this.client.rest.methods.removeMemberRole(this,t)}removeRoles(t){const e=this._roles.slice();if(t instanceof o)for(const n of t.values()){const t=e.indexOf(n.id);t>=0&&e.splice(t,1)}else for(const n of t){const t=e.indexOf(n instanceof s?n.id:n);t>=0&&e.splice(t,1)}return this.edit({roles:e})}setNickname(t){return this.edit({nick:t})}createDM(){return this.user.createDM()}deleteDM(){return this.user.deleteDM()}kick(){return this.client.rest.methods.kickGuildMember(this.guild,this)}ban(t=0){return this.client.rest.methods.banGuildMember(this.guild,this,t)}toString(){return`<@${this.nickname?"!":""}${this.user.id}>`}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendCode(){}}i.applyToClass(c),t.exports=c},function(t,e,n){const i=n(32),s=n(34),r=n(35),o=n(4),u=n(3),c=n(0),h=n(6);let a;class l{constructor(t,e,n){Object.defineProperty(this,"client",{value:n}),this.channel=t,e&&this.setup(e)}setup(t){this.id=t.id,this.type=c.MessageTypes[t.type],this.content=t.content,this.author=this.client.dataManager.newUser(t.author),this.member=this.guild?this.guild.member(this.author)||null:null,this.pinned=t.pinned,this.tts=t.tts,this.nonce=t.nonce,this.system=6===t.type,this.embeds=t.embeds.map(t=>new s(this,t)),this.attachments=new u;for(const e of t.attachments)this.attachments.set(e.id,new i(this,e));this.createdTimestamp=new Date(t.timestamp).getTime(),this.editedTimestamp=t.edited_timestamp?new Date(t.edited_timestamp).getTime():null,this.mentions={users:new u,roles:new u,channels:new u,everyone:t.mention_everyone};for(const n of t.mentions){let t=this.client.users.get(n.id);t||(t=this.client.dataManager.newUser(n)),this.mentions.users.set(t.id,t)}if(Object.defineProperty(this.mentions,"members",{get:()=>{if("text"!==this.channel.type)return null;const t=new u;return this.mentions.users.forEach(e=>{const n=this.client.resolver.resolveGuildMember(this.channel.guild,e);n&&t.set(n.id,n)}),t}}),t.mention_roles)for(const n of t.mention_roles){const t=this.channel.guild.roles.get(n);t&&this.mentions.roles.set(t.id,t)}if("text"===this.channel.type){const e=t.content.match(/<#([0-9]{14,20})>/g)||[];for(const n of e){const t=this.channel.guild.channels.get(n.match(/([0-9]{14,20})/g)[0]);t&&this.mentions.channels.set(t.id,t)}}if(this._edits=[],this.reactions=new u,t.reactions&&t.reactions.length>0)for(const o of t.reactions){const t=o.emoji.id?`${o.emoji.name}:${o.emoji.id}`:o.emoji.name;this.reactions.set(t,new r(this,o.emoji,o.count,o.me))}this.webhookID=t.webhook_id||null,this.hit="boolean"==typeof t.hit?t.hit:null}patch(t){if(t.author&&(this.author=this.client.users.get(t.author.id),this.guild&&(this.member=this.guild.member(this.author))),t.content&&(this.content=t.content),t.timestamp&&(this.createdTimestamp=new Date(t.timestamp).getTime()),t.edited_timestamp&&(this.editedTimestamp=t.edited_timestamp?new Date(t.edited_timestamp).getTime():null),"tts"in t&&(this.tts=t.tts),"mention_everyone"in t&&(this.mentions.everyone=t.mention_everyone),t.nonce&&(this.nonce=t.nonce),t.embeds&&(this.embeds=t.embeds.map(t=>new s(this,t))),t.type>-1&&(this.system=!1,6===t.type&&(this.system=!0)),t.attachments){this.attachments.clear();for(const e of t.attachments)this.attachments.set(e.id,new i(this,e))}if(t.mentions){this.mentions.users.clear();for(const e of t.mentions){let t=this.client.users.get(e.id);t?this.mentions.users.set(t.id,t):(t=this.client.dataManager.newUser(e),this.mentions.users.set(t.id,t))}}if(t.mention_roles){this.mentions.roles.clear();for(const e of t.mention_roles){const t=this.channel.guild.roles.get(e);t&&this.mentions.roles.set(t.id,t)}}if(t.id&&(this.id=t.id),this.channel.guild&&t.content){this.mentions.channels.clear();const e=t.content.match(/<#([0-9]{14,20})>/g)||[];for(const n of e){const t=this.channel.guild.channels.get(n.match(/([0-9]{14,20})/g)[0]);t&&this.mentions.channels.set(t.id,t)}}if(t.reactions&&(this.reactions.clear(),t.reactions.length>0))for(const e of t.reactions){const t=e.emoji.id?`${e.emoji.name}:${e.emoji.id}`:e.emoji.name;this.reactions.set(t,new r(this,e.emoji,e.count,e.me))}}get createdAt(){return new Date(this.createdTimestamp)}get editedAt(){return this.editedTimestamp?new Date(this.editedTimestamp):null}get guild(){return this.channel.guild||null}get cleanContent(){return this.content.replace(/@(everyone|here)/g,"@​$1").replace(/<@!?[0-9]+>/g,t=>{const e=t.replace(/<|!|>|@/g,"");if("dm"===this.channel.type||"group"===this.channel.type)return this.client.users.has(e)?`@${this.client.users.get(e).username}`:t;const n=this.channel.guild.members.get(e);if(n)return n.nickname?`@${n.nickname}`:`@${n.user.username}`;{const n=this.client.users.get(e);return n?`@${n.username}`:t}}).replace(/<#[0-9]+>/g,t=>{const e=this.client.channels.get(t.replace(/<|#|>/g,""));return e?`#${e.name}`:t}).replace(/<@&[0-9]+>/g,t=>{if("dm"===this.channel.type||"group"===this.channel.type)return t;const e=this.guild.roles.get(t.replace(/<|@|>|&/g,""));return e?`@${e.name}`:t})}get edits(){const t=this._edits.slice();return t.unshift(this),t}get editable(){return this.author.id===this.client.user.id}get deletable(){return this.author.id===this.client.user.id||this.guild&&this.channel.permissionsFor(this.client.user).hasPermission(h.FLAGS.MANAGE_MESSAGES)}get pinnable(){return!this.guild||this.channel.permissionsFor(this.client.user).hasPermission(h.FLAGS.MANAGE_MESSAGES)}isMentioned(t){return t=t&&t.id?t.id:t,this.mentions.users.has(t)||this.mentions.channels.has(t)||this.mentions.roles.has(t)}isMemberMentioned(t){return a||(a=n(12)),!!this.mentions.everyone||(!!this.mentions.users.has(t.id)||!!(t instanceof a&&t.roles.some(t=>this.mentions.roles.has(t.id))))}edit(t,e){return e||"object"!=typeof t||t instanceof Array?e||(e={}):(e=t,t=""),this.client.rest.methods.updateMessage(this,t,e)}editCode(t,e){return e=o.escapeMarkdown(this.client.resolver.resolveString(e),!0),this.edit(`\`\`\`${t||""} ${e} \`\`\``)}pin(){return this.client.rest.methods.pinMessage(this)}unpin(){return this.client.rest.methods.unpinMessage(this)}react(t){if(t=this.client.resolver.resolveEmojiIdentifier(t),!t)throw new TypeError("Emoji must be a string or Emoji/ReactionEmoji");return this.client.rest.methods.addMessageReaction(this,t)}clearReactions(){return this.client.rest.methods.removeMessageReactions(this)}delete(t=0){return t<=0?this.client.rest.methods.deleteMessage(this):new Promise(e=>{this.client.setTimeout(()=>{e(this.delete())},t)})}reply(t,e){return e||"object"!=typeof t||t instanceof Array?e||(e={}):(e=t,t=""),this.channel.send(t,Object.assign(e,{reply:this.member||this.author}))}acknowledge(){return this.client.rest.methods.ackMessage(this)}fetchWebhook(){return this.webhookID?this.client.fetchWebhook(this.webhookID):Promise.reject(new Error("The message was not sent by a webhook."))}equals(t,e){if(!t)return!1;const n=!t.author&&!t.attachments;if(n)return this.id===t.id&&this.embeds.length===t.embeds.length;let i=this.id===t.id&&this.author.id===t.author.id&&this.content===t.content&&this.tts===t.tts&&this.nonce===t.nonce&&this.embeds.length===t.embeds.length&&this.attachments.length===t.attachments.length;return i&&e&&(i=this.mentions.everyone===t.mentions.everyone&&this.createdTimestamp===new Date(e.timestamp).getTime()&&this.editedTimestamp===new Date(e.edited_timestamp).getTime()),i}toString(){return this.content}_addReaction(t,e){const n=t.id?`${t.name}:${t.id}`:encodeURIComponent(t.name);let i;return this.reactions.has(n)?(i=this.reactions.get(n),i.me||(i.me=e.id===this.client.user.id)):(i=new r(this,t,0,e.id===this.client.user.id),this.reactions.set(n,i)),i.users.has(e.id)||i.users.set(e.id,e),i.count++,i}_removeReaction(t,e){const n=t.id?`${t.name}:${t.id}`:encodeURIComponent(t.name);if(this.reactions.has(n)){const t=this.reactions.get(n);if(t.users.has(e.id))return t.users.delete(e.id),t.count--,e.id===this.client.user.id&&(t.me=!1),t}return null}_clearReactions(){this.reactions.clear()}}t.exports=l},function(t,e,n){const i=n(24),s=n(13),r=n(33),o=n(3);class u{constructor(){this.messages=new o,this.lastMessageID=null,this.lastMessage=null}send(t,e){if(e||"object"!=typeof t||t instanceof Array?e||(e={}):(e=t,t=""),e.embed&&e.embed.file&&(e.file=e.embed.file),e.file&&(e.files?e.files.push(e.file):e.files=[e.file]),e.files){for(const n in e.files){let t=e.files[n];"string"==typeof t&&(t={attachment:t}),t.name||("string"==typeof t.attachment?t.name=i.basename(t.attachment):t.attachment&&t.attachment.path?t.name=i.basename(t.attachment.path):t.name="file.jpg"),e.files[n]=t}return Promise.all(e.files.map(t=>this.client.resolver.resolveBuffer(t.attachment).then(e=>{return t.file=e,t}))).then(n=>this.client.rest.methods.sendMessage(this,t,e,n))}return this.client.rest.methods.sendMessage(this,t,e)}sendMessage(t,e){return this.send(t,e)}sendEmbed(t,e,n){return n||"object"!=typeof e||e instanceof Array?n||(n={}):(n=e,e=""),this.send(e,Object.assign(n,{embed:t}))}sendFiles(t,e,n={}){return this.send(e,Object.assign(n,{files:t}))}sendFile(t,e,n,i={}){return this.sendFiles([{attachment:t,name:e}],n,i)}sendCode(t,e,n={}){return this.send(e,Object.assign(n,{code:t}))}fetchMessage(t){return this.client.user.bot?this.client.rest.methods.getChannelMessage(this,t).then(t=>{const e=t instanceof s?t:new s(this,t,this.client);return this._cacheMessage(e),e}):this.fetchMessages({limit:1,around:t}).then(e=>{const n=e.first();if(n.id!==t)throw new Error("Message not found.");return n})}fetchMessages(t={}){return this.client.rest.methods.getChannelMessages(this,t).then(t=>{const e=new o;for(const n of t){const t=new s(this,n,this.client);e.set(n.id,t),this._cacheMessage(t)}return e})}fetchPinnedMessages(){return this.client.rest.methods.getChannelPinnedMessages(this).then(t=>{const e=new o;for(const n of t){const t=new s(this,n,this.client);e.set(n.id,t),this._cacheMessage(t)}return e})}search(t){return this.client.rest.methods.search(this,t)}startTyping(t){if("undefined"!=typeof t&&t<1)throw new RangeError("Count must be at least 1.");if(this.client.user._typing.has(this.id)){const e=this.client.user._typing.get(this.id);e.count=t||e.count+1}else this.client.user._typing.set(this.id,{count:t||1,interval:this.client.setInterval(()=>{this.client.rest.methods.sendTyping(this.id)},9e3)}),this.client.rest.methods.sendTyping(this.id)}stopTyping(t=false){if(this.client.user._typing.has(this.id)){const e=this.client.user._typing.get(this.id);e.count--,(e.count<=0||t)&&(this.client.clearInterval(e.interval),this.client.user._typing.delete(this.id))}}get typing(){return this.client.user._typing.has(this.id)}get typingCount(){return this.client.user._typing.has(this.id)?this.client.user._typing.get(this.id).count:0}createCollector(t,e={}){return new r(this,t,e)}awaitMessages(t,e={}){return new Promise((n,i)=>{const s=this.createCollector(t,e);s.on("end",(t,s)=>{e.errors&&e.errors.includes(s)?i(t):n(t)})})}bulkDelete(t,e=false){if(!isNaN(t))return this.fetchMessages({limit:t}).then(t=>this.bulkDelete(t,e));if(t instanceof Array||t instanceof o){const n=t instanceof o?t.keyArray():t.map(t=>t.id);return this.client.rest.methods.bulkDeleteMessages(this,n,e)}throw new TypeError("The messages must be an Array, Collection, or number.")}acknowledge(){return this.client.rest.methods.ackTextMessage(this)}_cacheMessage(t){const e=this.client.options.messageCacheMaxSize;return 0===e?null:(this.messages.size>=e&&e>0&&this.messages.delete(this.messages.firstKey()),this.messages.set(t.id,t),t)}}e.applyToClass=((t,e=false,n=[])=>{const i=["send","sendMessage","sendEmbed","sendFile","sendFiles","sendCode"];e&&i.push("_cacheMessage","fetchMessages","fetchMessage","search","bulkDelete","startTyping","stopTyping","typing","typingCount","fetchPinnedMessages","createCollector","awaitMessages");for(const s of i)n.includes(s)||Object.defineProperty(t.prototype,s,Object.getOwnPropertyDescriptor(u.prototype,s))})},function(t,e){e.endianness=function(){return"LE"},e.hostname=function(){return"undefined"!=typeof location?location.hostname:""},e.loadavg=function(){return[]},e.uptime=function(){return 0},e.freemem=function(){return Number.MAX_VALUE},e.totalmem=function(){return Number.MAX_VALUE},e.cpus=function(){return[]},e.type=function(){return"Browser"},e.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},e.networkInterfaces=e.getNetworkInterfaces=function(){return{}},e.arch=function(){return"javascript"},e.platform=function(){return"browser"},e.tmpdir=e.tmpDir=function(){return"/tmp"},e.EOL="\n"},function(t,e,n){const i=n(10),s=n(9),r=n(11),o=n(7).Presence,u=n(12),c=n(0),h=n(3),a=n(4),l=n(5);class f{constructor(t,e){Object.defineProperty(this,"client",{value:t}),this.members=new h,this.channels=new h,this.roles=new h,this.presences=new h,e&&(e.unavailable?(this.available=!1,this.id=e.id):(this.available=!0,this.setup(e)))}setup(t){this.name=t.name,this.icon=t.icon,this.splash=t.splash,this.region=t.region,this.memberCount=t.member_count||this.memberCount,this.large=Boolean("large"in t?t.large:this.large),this.features=t.features,this.applicationID=t.application_id,this.emojis=new h;for(const e of t.emojis)this.emojis.set(e.id,new r(this,e));if(this.afkTimeout=t.afk_timeout,this.afkChannelID=t.afk_channel_id,this.embedEnabled=t.embed_enabled,this.verificationLevel=t.verification_level,this.joinedTimestamp=t.joined_at?new Date(t.joined_at).getTime():this.joinedTimestamp,this.id=t.id,this.available=!t.unavailable,this.features=t.features||this.features||[],t.members){this.members.clear();for(const e of t.members)this._addMember(e,!1)}if(t.owner_id&&(this.ownerID=t.owner_id),t.channels){this.channels.clear();for(const e of t.channels)this.client.dataManager.newChannel(e,this)}if(t.roles){this.roles.clear();for(const e of t.roles){const t=new s(this,e);this.roles.set(t.id,t)}}if(t.presences)for(const n of t.presences)this._setPresence(n.user.id,n);if(this._rawVoiceStates=new h,t.voice_states)for(const i of t.voice_states){this._rawVoiceStates.set(i.user_id,i);const t=this.members.get(i.user_id);t&&(t.serverMute=i.mute,t.serverDeaf=i.deaf,t.selfMute=i.self_mute,t.selfDeaf=i.self_deaf,t.voiceSessionID=i.session_id,t.voiceChannelID=i.channel_id,this.channels.get(i.channel_id).members.set(t.user.id,t))}}get createdTimestamp(){return l.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get joinedAt(){return new Date(this.joinedTimestamp)}get iconURL(){return this.icon?c.Endpoints.guildIcon(this.id,this.icon):null}get splashURL(){return this.splash?c.Endpoints.guildSplash(this.id,this.splash):null}get owner(){return this.members.get(this.ownerID)}get voiceConnection(){return this.client.browser?null:this.client.voice.connections.get(this.id)||null}get defaultChannel(){return this.channels.get(this.id)}get defaultRole(){return this.roles.get(this.id)}member(t){return this.client.resolver.resolveGuildMember(this,t)}fetchBans(){return this.client.rest.methods.getGuildBans(this)}fetchInvites(){return this.client.rest.methods.getGuildInvites(this)}fetchWebhooks(){return this.client.rest.methods.getGuildWebhooks(this)}fetchVoiceRegions(){return this.client.rest.methods.fetchVoiceRegions(this.id)}addMember(t,e){return this.members.has(t.id)?Promise.resolve(this.members.get(t.id)):this.client.rest.methods.putGuildMember(this,t,e)}fetchMember(t,e=true){return t=this.client.resolver.resolveUser(t),t?this.members.has(t.id)?Promise.resolve(this.members.get(t.id)):this.client.rest.methods.getGuildMember(this,t,e):Promise.reject(new Error("User is not cached. Use Client.fetchUser first."))}fetchMembers(t="",e=0){return new Promise((n,i)=>{if(this.memberCount===this.members.size)return void n(this);this.client.ws.send({op:c.OPCodes.REQUEST_GUILD_MEMBERS,d:{guild_id:this.id,query:t,limit:e}});const s=(t,e)=>{e.id===this.id&&(this.memberCount===this.members.size||t.length<1e3)&&(this.client.removeListener(c.Events.GUILD_MEMBERS_CHUNK,s),n(this))};this.client.on(c.Events.GUILD_MEMBERS_CHUNK,s),this.client.setTimeout(()=>i(new Error("Members didn't arrive in time.")),12e4)})}search(t){return this.client.rest.methods.search(this,t)}edit(t){return this.client.rest.methods.updateGuild(this,t)}setName(t){return this.edit({name:t})}setRegion(t){return this.edit({region:t})}setVerificationLevel(t){return this.edit({verificationLevel:t})}setAFKChannel(t){return this.edit({afkChannel:t})}setAFKTimeout(t){return this.edit({afkTimeout:t})}setIcon(t){return this.edit({icon:t})}setOwner(t){return this.edit({owner:t})}setSplash(t){return this.edit({splash:t})}ban(t,e=0){return this.client.rest.methods.banGuildMember(this,t,e)}unban(t){return this.client.rest.methods.unbanGuildMember(this,t)}pruneMembers(t,e=false){if("number"!=typeof t)throw new TypeError("Days must be a number.");return this.client.rest.methods.pruneGuildMembers(this,t,e)}sync(){this.client.user.bot||this.client.syncGuilds([this])}createChannel(t,e,n){return this.client.rest.methods.createChannel(this,t,e,n)}setChannelPositions(t){return this.client.rest.methods.updateChannelPositions(this.id,t)}createRole(t){return this.client.rest.methods.createGuildRole(this,t)}setRolePosition(t,e,n=false){if("string"==typeof t&&(t=this.roles.get(t),!t))return Promise.reject(new Error("Supplied role is not a role or string."));if(e=Number(e),isNaN(e))return Promise.reject(new Error("Supplied position is not a number."));let i=Object.assign([],this.roles.array().sort((t,e)=>t.position!==e.position?t.position-e.position:t.id-e.id));return a.moveElementInArray(i,t,e,n),i=i.map((t,e)=>({id:t.id,position:e})),this.client.rest.methods.setRolePositions(this.id,i)}createEmoji(t,e,n){return new Promise(i=>{"string"==typeof t&&t.startsWith("data:")?i(this.client.rest.methods.createEmoji(this,t,e,n)):this.client.resolver.resolveBuffer(t).then(t=>{const s=this.client.resolver.resolveBase64(t);i(this.client.rest.methods.createEmoji(this,s,e,n))})})}deleteEmoji(t){return t instanceof r||(t=this.emojis.get(t)),this.client.rest.methods.deleteEmoji(t)}leave(){return this.client.rest.methods.leaveGuild(this)}delete(){return this.client.rest.methods.deleteGuild(this)}acknowledge(){return this.client.rest.methods.ackGuild(this)}equals(t){let e=t&&this.id===t.id&&this.available===!t.unavailable&&this.splash===t.splash&&this.region===t.region&&this.name===t.name&&this.memberCount===t.member_count&&this.large===t.large&&this.icon===t.icon&&a.arraysEqual(this.features,t.features)&&this.ownerID===t.owner_id&&this.verificationLevel===t.verification_level&&this.embedEnabled===t.embed_enabled;return e&&(this.embedChannel?this.embedChannel.id!==t.embed_channel_id&&(e=!1):t.embed_channel_id&&(e=!1)),e}toString(){return this.name}_addMember(t,e=true){const n=this.members.has(t.user.id);t.user instanceof i||(t.user=this.client.dataManager.newUser(t.user)),t.joined_at=t.joined_at||0;const s=new u(this,t);if(this.members.set(s.id,s),this._rawVoiceStates&&this._rawVoiceStates.has(s.user.id)){const t=this._rawVoiceStates.get(s.user.id);s.serverMute=t.mute,s.serverDeaf=t.deaf,s.selfMute=t.self_mute,s.selfDeaf=t.self_deaf,s.voiceSessionID=t.session_id,s.voiceChannelID=t.channel_id,this.client.channels.has(t.channel_id)?this.client.channels.get(t.channel_id).members.set(s.user.id,s):this.client.emit("warn",`Member ${s.id} added in guild ${this.id} with an uncached voice channel`)}return this.client.ws.status===c.Status.READY&&e&&!n&&this.client.emit(c.Events.GUILD_MEMBER_ADD,s),s}_updateMember(t,e){const n=a.cloneObject(t);e.roles&&(t._roles=e.roles),"undefined"!=typeof e.nick&&(t.nickname=e.nick);const i=t.nickname!==n.nickname||!a.arraysEqual(t._roles,n._roles);return this.client.ws.status===c.Status.READY&&i&&this.client.emit(c.Events.GUILD_MEMBER_UPDATE,n,t),{old:n,mem:t}}_removeMember(t){this.members.delete(t.id)}_memberSpeakUpdate(t,e){const n=this.members.get(t);n&&n.speaking!==e&&(n.speaking=e,this.client.emit(c.Events.GUILD_MEMBER_SPEAKING,n,e))}_setPresence(t,e){return this.presences.get(t)?void this.presences.get(t).update(e):void this.presences.set(t,new o(e))}}t.exports=f},function(t,e,n){const i=n(8),s=n(9),r=n(39),o=n(6),u=n(3);class c extends i{constructor(t,e){super(t.client,e),this.guild=t}setup(t){if(super.setup(t),this.name=t.name,this.position=t.position,this.permissionOverwrites=new u,t.permission_overwrites)for(const e of t.permission_overwrites)this.permissionOverwrites.set(e.id,new r(this,e))}permissionsFor(t){if(t=this.client.resolver.resolveGuildMember(this.guild,t),!t)return null;if(t.id===this.guild.ownerID)return new o(t,o.ALL);let e=0;const n=t.roles;for(const i of n.values())e|=i.permissions;const s=this.overwritesFor(t,!0,n);s.everyone&&(e&=~s.everyone.deny,e|=s.everyone.allow);let r=0;for(const u of s.roles)e&=~u.deny,r|=u.allow;e|=r,s.member&&(e&=~s.member.deny,e|=s.member.allow);const c=Boolean(e&o.FLAGS.ADMINISTRATOR);return c&&(e=o.ALL),new o(t,e)}overwritesFor(t,e=false,n=null){if(e||(t=this.client.resolver.resolveGuildMember(this.guild,t)),!t)return[];n=n||t.roles;const i=[];let s,r;for(const o of this.permissionOverwrites.values())o.id===this.guild.id?r=o:n.has(o.id)?i.push(o):o.id===t.id&&(s=o);return{everyone:r,roles:i,member:s}}overwritePermissions(t,e){const n={allow:0,deny:0};if(t instanceof s)n.type="role";else if(this.guild.roles.has(t))t=this.guild.roles.get(t),n.type="role";else if(t=this.client.resolver.resolveUser(t),n.type="member",!t)return Promise.reject(new TypeError("Supplied parameter was neither a User nor a Role."));n.id=t.id;const i=this.permissionOverwrites.get(t.id);i&&(n.allow=i.allow,n.deny=i.deny);for(const r in e)e[r]===!0?(n.allow|=o.FLAGS[r]||0,n.deny&=~(o.FLAGS[r]||0)):e[r]===!1?(n.allow&=~(o.FLAGS[r]||0),n.deny|=o.FLAGS[r]||0):null===e[r]&&(n.allow&=~(o.FLAGS[r]||0),n.deny&=~(o.FLAGS[r]||0));return this.client.rest.methods.setChannelOverwrite(this,n)}edit(t){return this.client.rest.methods.updateChannel(this,t)}setName(t){return this.edit({name:t})}setPosition(t){return this.client.rest.methods.updateChannel(this,{position:t})}setTopic(t){return this.client.rest.methods.updateChannel(this,{topic:t})}createInvite(t={}){return this.client.rest.methods.createChannelInvite(this,t)}clone(t=this.name,e=true,n=true){return this.guild.createChannel(t,this.type,e?this.permissionOverwrites:[]).then(t=>n?t.setTopic(this.topic):t)}equals(t){let e=t&&this.id===t.id&&this.type===t.type&&this.topic===t.topic&&this.position===t.position&&this.name===t.name;return e&&(e=this.permissionOverwrites&&t.permissionOverwrites?this.permissionOverwrites.equals(t.permissionOverwrites):!this.permissionOverwrites&&!t.permissionOverwrites),e}get deletable(){return this.id!==this.guild.id&&this.permissionsFor(this.client.user).hasPermission(o.FLAGS.MANAGE_CHANNELS)}toString(){return`<#${this.id}>`}}t.exports=c},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(t){if(a===setTimeout)return setTimeout(t,0);if((a===n||!a)&&setTimeout)return a=setTimeout,setTimeout(t,0);try{return a(t,0)}catch(e){try{return a.call(null,t,0)}catch(e){return a.call(this,t,0)}}}function r(t){if(l===clearTimeout)return clearTimeout(t);if((l===i||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function o(){m&&d&&(m=!1,d.length?p=d.concat(p):g=-1,p.length&&u())}function u(){if(!m){var t=s(o);m=!0;for(var e=p.length;e;){for(d=p,p=[];++g1)for(var n=1;n[t.id,t.nick]))),this.recipients||(this.recipients=new r),t.recipients)for(const e of t.recipients){const t=this.client.dataManager.newUser(e);this.recipients.set(t.id,t)}this.lastMessageID=t.last_message_id}get owner(){return this.client.users.get(this.ownerID)}equals(t){const e=t&&this.id===t.id&&this.name===t.name&&this.icon===t.icon&&this.ownerID===t.ownerID;return e?this.recipients.equals(t.recipients):e}addUser(t,e){return this.client.rest.methods.addUserToGroupDM(this,{nick:e,id:this.client.resolver.resolveUserID(t),accessToken:t})}toString(){return this.name}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendFiles(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}acknowledge(){}_cacheMessage(){}}s.applyToClass(o,!0,["bulkDelete"]),t.exports=o},function(t,e){class n{constructor(t,e,n){this.reaction=t,this.name=e,this.id=n}get identifier(){return this.id?`${this.name}:${this.id}`:encodeURIComponent(this.name)}toString(){return this.id?`<:${this.name}:${this.id}>`:this.name}}t.exports=n},function(t,e,n){const i=n(24);class s{constructor(t,e,n){t?(Object.defineProperty(this,"client",{value:t}),e&&this.setup(e)):(this.id=e,this.token=n,Object.defineProperty(this,"client",{value:this}))}setup(t){this.name=t.name,this.token=t.token,this.avatar=t.avatar,this.id=t.id,this.guildID=t.guild_id,this.channelID=t.channel_id,t.user?this.owner=this.client.users?this.client.users.get(t.user.id):t.user:this.owner=null}send(t,e){return e||"object"!=typeof t||t instanceof Array?e||(e={}):(e=t,t=""),e.file?("string"==typeof e.file&&(e.file={attachment:e.file}),e.file.name||("string"==typeof e.file.attachment?e.file.name=i.basename(e.file.attachment):e.file.attachment&&e.file.attachment.path?e.file.name=i.basename(e.file.attachment.path):e.file.name="file.jpg"),this.client.resolver.resolveBuffer(e.file.attachment).then(n=>this.client.rest.methods.sendWebhookMessage(this,t,e,{file:n,name:e.file.name}))):this.client.rest.methods.sendWebhookMessage(this,t,e)}sendMessage(t,e={}){return this.send(t,e)}sendFile(t,e,n,i={}){return this.send(n,Object.assign(i,{file:{attachment:t,name:e}}))}sendCode(t,e,n={}){return this.send(e,Object.assign(n,{code:t}))}sendSlackMessage(t){return this.client.rest.methods.sendSlackWebhookMessage(this,t)}edit(t=this.name,e){return e?this.client.resolver.resolveBuffer(e).then(e=>{const n=this.client.resolver.resolveBase64(e);return this.client.rest.methods.editWebhook(this,t,n)}):this.client.rest.methods.editWebhook(this,t).then(t=>{return this.setup(t),this})}delete(){return this.client.rest.methods.deleteWebhook(this)}}t.exports=s},function(t,e,n){"use strict";(function(t){function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function s(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function r(t,e){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function g(t){return+t!=t&&(t=0),o.alloc(+t)}function E(t,e){if(o.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(t).length;default:if(i)return W(t).length;e=(""+e).toLowerCase(),i=!0}}function _(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,n);case"utf8":case"utf-8":return I(this,e,n);case"ascii":return L(this,e,n);case"latin1":case"binary":return U(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function v(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function y(t,e,n,i,s){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=s?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(s)return-1;n=t.length-1}else if(n<0){if(!s)return-1;n=0}if("string"==typeof e&&(e=o.from(e,i)),o.isBuffer(e))return 0===e.length?-1:w(t,e,n,i,s);if("number"==typeof e)return e&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,i,s);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,i,s){function r(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,u=t.length,c=e.length;if(void 0!==i&&(i=String(i).toLowerCase(),"ucs2"===i||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,u/=2,c/=2,n/=2}var h;if(s){var a=-1;for(h=n;hu&&(n=u-c),h=n;h>=0;h--){for(var l=!0,f=0;fs&&(i=s)):i=s;var r=e.length;if(r%2!==0)throw new TypeError("Invalid hex string");i>r/2&&(i=r/2);for(var o=0;o239?4:r>223?3:r>191?2:1;if(s+u<=n){var c,h,a,l;switch(u){case 1:r<128&&(o=r);break;case 2:c=t[s+1],128===(192&c)&&(l=(31&r)<<6|63&c,l>127&&(o=l));break;case 3:c=t[s+1],h=t[s+2],128===(192&c)&&128===(192&h)&&(l=(15&r)<<12|(63&c)<<6|63&h,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:c=t[s+1],h=t[s+2],a=t[s+3],128===(192&c)&&128===(192&h)&&128===(192&a)&&(l=(15&r)<<18|(63&c)<<12|(63&h)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,u=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),s+=u}return C(i)}function C(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var n="",i=0;ii)&&(n=i);for(var s="",r=e;rn)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,n,i,s,r){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>s||et.length)throw new RangeError("Index out of range")}function x(t,e,n,i){e<0&&(e=65535+e+1);for(var s=0,r=Math.min(t.length-n,2);s>>8*(i?s:1-s)}function G(t,e,n,i){e<0&&(e=4294967295+e+1);for(var s=0,r=Math.min(t.length-n,4);s>>8*(i?s:3-s)&255}function j(t,e,n,i,s,r){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function B(t,e,n,i,s){return s||j(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,n,i,23,4),n+4}function q(t,e,n,i,s){return s||j(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,n,i,52,8),n+8}function H(t){if(t=V(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function V(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Y(t){return t<16?"0"+t.toString(16):t.toString(16)}function W(t,e){e=e||1/0;for(var n,i=t.length,s=null,r=[],o=0;o55295&&n<57344){if(!s){if(n>56319){(e-=3)>-1&&r.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&r.push(239,191,189);continue}s=n;continue}if(n<56320){(e-=3)>-1&&r.push(239,191,189),s=n;continue}n=(s-55296<<10|n-56320)+65536}else s&&(e-=3)>-1&&r.push(239,191,189);if(s=null,n<128){if((e-=1)<0)break;r.push(n)}else if(n<2048){if((e-=2)<0)break;r.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;r.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;r.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return r}function F(t){for(var e=[],n=0;n>8,s=n%256,r.push(s),r.push(i);return r}function z(t){return $.toByteArray(H(t))}function X(t,e,n,i){for(var s=0;s=e.length||s>=t.length);++s)e[s+n]=t[s];return s}function J(t){return t!==t}/*! * The buffer module from node.js, for the browser.