From cbb1eb1fc77184d76fb79480039e5d064e8873bb Mon Sep 17 00:00:00 2001 From: Travis CI Date: Mon, 24 Apr 2017 06:23:27 +0000 Subject: [PATCH] Webpack build for branch master: fb5b8f8548ee8e47c0e287e1d170e1216532daf7 --- 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 b715cd06..372a924a 100644 --- a/discord.master.js +++ b/discord.master.js @@ -11355,7 +11355,6 @@ module.exports = { "node-opus": "^0.2.5", "opusscript": "^0.0.3", "sodium": "^2.0.1", - "uws": "^0.14.1", "libsodium-wrappers": "^0.5.1" }, "devDependencies": { diff --git a/discord.master.min.js b/discord.master.min.js index dfb98fae..b7e49d1a 100644 --- a/discord.master.min.js +++ b/discord.master.min.js @@ -11,7 +11,7 @@ ${t} * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/long.js for details */ -!function(n,o){s=[],i=o,void 0!==(r="function"==typeof i?i.apply(t,s):i)&&(e.exports=r)}(0,function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}function n(e,t){var n,i,r;return t?(e>>>=0,(r=0<=e&&e<256)&&(i=c[e])?i:(n=s(e,(0|e)<0?-1:0,!0),r&&(c[e]=n),n)):(e|=0,(r=-128<=e&&e<128)&&(i=a[e])?i:(n=s(e,e<0?-1:0,!1),r&&(a[e]=n),n))}function i(e,t){if(isNaN(e)||!isFinite(e))return t?m:f;if(t){if(e<0)return m;if(e>=h)return w}else{if(e<=-p)return y;if(e+1>=p)return E}return e<0?i(-e,t).neg():s(e%l|0,e/l|0,t)}function s(t,n,i){return new e(t,n,i)}function r(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return f;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===s)return r(e.substring(1),t,n).neg();for(var o=i(u(n,8)),a=f,c=0;c>>0:this.low},_.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},_.toString=function(e){if((e=e||10)<2||36>>0,h=l.toString(e);if(o=c,o.isZero())return h+a;for(;h.length<6;)h="0"+h;a=""+h+a}},_.getHighBits=function(){return this.high},_.getHighBitsUnsigned=function(){return this.high>>>0},_.getLowBits=function(){return this.low},_.getLowBitsUnsigned=function(){return this.low>>>0},_.getNumBitsAbs=function(){if(this.isNegative())return this.eq(y)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},_.isOdd=function(){return 1==(1&this.low)},_.isEven=function(){return 0==(1&this.low)},_.equals=function(e){return t(e)||(e=o(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},_.eq=_.equals,_.notEquals=function(e){return!this.eq(e)},_.neq=_.notEquals,_.lessThan=function(e){return this.comp(e)<0},_.lt=_.lessThan,_.lessThanOrEqual=function(e){return this.comp(e)<=0},_.lte=_.lessThanOrEqual,_.greaterThan=function(e){return this.comp(e)>0},_.gt=_.greaterThan,_.greaterThanOrEqual=function(e){return this.comp(e)>=0},_.gte=_.greaterThanOrEqual,_.compare=function(e){if(t(e)||(e=o(e)),this.eq(e))return 0;var n=this.isNegative(),i=e.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},_.comp=_.compare,_.negate=function(){return!this.unsigned&&this.eq(y)?y:this.not().add(g)},_.neg=_.negate,_.add=function(e){t(e)||(e=o(e));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,c=e.high>>>16,u=65535&e.high,l=e.low>>>16,h=65535&e.low,p=0,d=0,f=0,m=0;return m+=a+h,f+=m>>>16,m&=65535,f+=r+l,d+=f>>>16,f&=65535,d+=i+u,p+=d>>>16,d&=65535,p+=n+c,p&=65535,s(f<<16|m,p<<16|d,this.unsigned)},_.subtract=function(e){return t(e)||(e=o(e)),this.add(e.neg())},_.sub=_.subtract,_.multiply=function(e){if(this.isZero())return f;if(t(e)||(e=o(e)),e.isZero())return f;if(this.eq(y))return e.isOdd()?y:f;if(e.eq(y))return this.isOdd()?y:f;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return i(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,a=this.low>>>16,c=65535&this.low,u=e.high>>>16,l=65535&e.high,h=e.low>>>16,p=65535&e.low,m=0,g=0,v=0,b=0;return b+=c*p,v+=b>>>16,b&=65535,v+=a*p,g+=v>>>16,v&=65535,v+=c*h,g+=v>>>16,v&=65535,g+=r*p,m+=g>>>16,g&=65535,g+=a*h,m+=g>>>16,g&=65535,g+=c*l,m+=g>>>16,g&=65535,m+=n*p+r*h+a*l+c*u,m&=65535,s(v<<16|b,m<<16|g,this.unsigned)},_.mul=_.multiply,_.divide=function(e){if(t(e)||(e=o(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?m:f;var n,s,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return m;if(e.gt(this.shru(1)))return v;r=m}else{if(this.eq(y)){if(e.eq(g)||e.eq(b))return y;if(e.eq(y))return g;return n=this.shr(1).div(e).shl(1),n.eq(f)?e.isNegative()?g:b:(s=this.sub(e.mul(n)),r=n.add(s.div(e)))}if(e.eq(y))return this.unsigned?m:f;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=f}for(s=this;s.gte(e);){n=Math.max(1,Math.floor(s.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),c=a<=48?1:u(2,a-48),l=i(n),h=l.mul(e);h.isNegative()||h.gt(s);)n-=c,l=i(n,this.unsigned),h=l.mul(e);l.isZero()&&(l=g),r=r.add(l),s=s.sub(h)}return r},_.div=_.divide,_.modulo=function(e){return t(e)||(e=o(e)),this.sub(this.div(e).mul(e))},_.mod=_.modulo,_.not=function(){return s(~this.low,~this.high,this.unsigned)},_.and=function(e){return t(e)||(e=o(e)),s(this.low&e.low,this.high&e.high,this.unsigned)},_.or=function(e){return t(e)||(e=o(e)),s(this.low|e.low,this.high|e.high,this.unsigned)},_.xor=function(e){return t(e)||(e=o(e)),s(this.low^e.low,this.high^e.high,this.unsigned)},_.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?s(this.low<>>32-e,this.unsigned):s(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):s(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},_.shr=_.shiftRight,_.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0===(e&=63))return this;var n=this.high;if(e<32){return s(this.low>>>e|n<<32-e,n>>>e,this.unsigned)}return 32===e?s(n,0,this.unsigned):s(n>>>e-32,0,this.unsigned)},_.shru=_.shiftRightUnsigned,_.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},_.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},_.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},_.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},_.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})},function(e,t,n){"use strict";(function(t){function n(e,n,i,s){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var r,o,a=arguments.length;switch(a){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,i)});case 4:return t.nextTick(function(){e.call(null,n,i,s)});default:for(r=new Array(a-1),o=0;o-1?i:A;a.WritableState=o;var T=n(20);T.inherits=n(10);var S={deprecate:n(98)},D=n(57),M=n(5).Buffer,C=n(31);T.inherits(a,D),o.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(o.prototype,"buffer",{get:S.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var I;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(a,Symbol.hasInstance,{value:function(e){return!!I.call(this,e)||e&&e._writableState instanceof o}})):I=function(e){return e instanceof this},a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},a.prototype.write=function(e,t,n){var i=this._writableState,r=!1,o=M.isBuffer(e);return"function"==typeof t&&(n=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=s),i.ended?c(this,n):(o||u(this,i,e,n))&&(i.pendingcb++,r=h(this,i,o,e,t,n)),r},a.prototype.cork=function(){this._writableState.corked++},a.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||b(this,e))},a.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},a.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},a.prototype._writev=null,a.prototype.end=function(e,t,n){var i=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||_(this,i,n)}}).call(t,n(6),n(95).setImmediate)},function(e,t,n){(function(t,i,s){const r=n(89),o="__SNEKFETCH_SYNC_REQUEST";let a=!0;for(let e of r.METHODS)e="M-SEARCH"===e?"msearch":e.toLowerCase(),r[`${e}Sync`]=((s,r={})=>{a&&(a=!1,console.error("Performing sync requests is a really stupid thing to do. https://www.google.com/search?q=why+sync+requests+are+bad+nodejs"));r.url=s;r.method=e;const c=n(27);const u=JSON.parse(c.execSync(`node ${t}/index.js`,{env:{[o]:JSON.stringify(r)}}).toString(),(e,t)=>{if(null===t)return t;if("Buffer"===t.type&&Array.isArray(t.data))return new i(t.data);if(t.__CONVERT_TO_ERROR){const e=new Error;for(const n of Object.keys(t))"__CONVERT_TO_ERROR"!==n&&(e[n]=t[n]);return e}return t});if(u.error)throw u.error;return u});if(s.env[o]){const e=JSON.parse(s.env[o]),t=r[e.method](e.url);e.headers&&t.set(e.headers),e.body&&t.send(e.body),t.end((e,t={})=>{if(e){const n={};for(const t of Object.getOwnPropertyNames(e))n[t]=e[t];t.error=n,t.error.__CONVERT_TO_ERROR=!0}t.request=null;s.stdout.write(JSON.stringify(t))})}e.exports=r}).call(t,"node_modules/snekfetch",n(5).Buffer,n(6))},function(e,t,n){(function(t){const i=n(26),s=n(27),r=n(36),o=n(0),a=n(4).convertToBuffer,c=n(16),u=n(19),l=n(24),h=n(14),p=n(18),d=n(17),f=n(29);class m{constructor(e){this.client=e}resolveUser(e){return e instanceof c?e:"string"==typeof e?this.client.users.get(e)||null:e instanceof p?e.user:e instanceof u?e.author:e instanceof l?e.owner:null}resolveUserID(e){return e instanceof c||e instanceof p?e.id:"string"==typeof e?e||null:e instanceof u?e.author.id:e instanceof l?e.ownerID:null}resolveGuild(e){return e instanceof l?e:"string"==typeof e?this.client.guilds.get(e)||null:null}resolveGuildMember(e,t){return t instanceof p?t:(e=this.resolveGuild(e),t=this.resolveUser(t),e&&t?e.members.get(t.id)||null:null)}resolveChannel(e){return e instanceof h?e:"string"==typeof e?this.client.channels.get(e)||null:e instanceof u?e.channel:e instanceof l?e.channels.get(e.id)||null:null}resolveChannelID(e){return e instanceof h?e.id:"string"==typeof e?e:e instanceof u?e.channel.id:e instanceof l?e.defaultChannel.id:null}resolveInviteCode(e){const t=/discord(?:app\.com\/invite|\.gg)\/([\w-]{2,255})/i,n=t.exec(e);return n&&n[1]?n[1]:e}resolveString(e){return"string"==typeof e?e:e instanceof Array?e.join("\n"):String(e)}resolveBase64(e){return e instanceof t?`data:image/jpg;base64,${e.toString("base64")}`:e}resolveBuffer(e){return e instanceof t?Promise.resolve(e):this.client.browser&&e instanceof ArrayBuffer?Promise.resolve(a(e)):"string"==typeof e?new Promise((n,o)=>{if(/^https?:\/\//.test(e))r.get(e).end((e,i)=>{if(e)return o(e);if(!(i.body instanceof t))return o(new TypeError("The response body isn't a Buffer."));return n(i.body)});else{const t=i.resolve(e);s.stat(t,(e,i)=>{if(e)return o(e);if(!i||!i.isFile())return o(new Error(`The file could not be found: ${t}`));s.readFile(t,(e,t)=>{e?o(e):n(t)});return null})}}):Promise.reject(new TypeError("The resource must be a string or Buffer."))}resolveEmojiIdentifier(e){return e instanceof d||e instanceof f?e.identifier:"string"==typeof e?this.client.emojis.has(e)?this.client.emojis.get(e).identifier:e.includes("%")?e:encodeURIComponent(e):null}static resolveColor(e){if("string"==typeof e){if("RANDOM"===e)return Math.floor(16777216*Math.random());e=o.Colors[e]||parseInt(e.replace("#",""),16)}else e instanceof Array&&(e=(e[0]<<16)+(e[1]<<8)+e[2]);if(e<0||e>16777215)throw new RangeError("Color must be within the range 0 - 16777215 (0xFFFFFF).");if(e&&isNaN(e))throw new TypeError("Unable to convert color to a number.");return e}resolveColor(e){return this.constructor.resolveColor(e)}}e.exports=m}).call(t,n(5).Buffer)},function(e,t){e.exports={name:"discord.js",version:"11.1.0",description:"A powerful library for interacting with the Discord API",main:"./src/index",types:"./typings/index.d.ts",scripts:{test:"npm run lint && npm run docs:test",docs:"docgen --source src --custom docs/index.yml --output docs/docs.json","docs:test":"docgen --source src --custom docs/index.yml",lint:"eslint src","lint:fix":"eslint --fix src",webpack:"parallel-webpack"},repository:{type:"git",url:"git+https://github.com/hydrabolt/discord.js.git"},keywords:["discord","api","bot","client","node","discordapp"],author:"Amish Shah ",license:"Apache-2.0",bugs:{url:"https://github.com/hydrabolt/discord.js/issues"},homepage:"https://github.com/hydrabolt/discord.js#readme",runkitExampleFilename:"./docs/examples/ping.js",dependencies:{long:"^3.2.0","prism-media":"^0.0.1",snekfetch:"^3.1.0",tweetnacl:"^0.14.0",ws:"^2.0.0"},peerDependencies:{bufferutil:"^2.0.0",erlpack:"hammerandchisel/erlpack","node-opus":"^0.2.5",opusscript:"^0.0.3",sodium:"^2.0.1",uws:"^0.14.1","libsodium-wrappers":"^0.5.1"},devDependencies:{"@types/node":"^7.0.0","discord.js-docgen":"hydrabolt/discord.js-docgen",eslint:"^3.19.0","parallel-webpack":"^1.6.0","uglify-js":"mishoo/UglifyJS2#harmony",webpack:"^2.2.0"},engines:{node:">=6.0.0"},browser:{ws:!1,uws:!1,erlpack:!1,"prism-media":!1,opusscript:!1,"node-opus":!1,tweetnacl:!1,sodium:!1,"src/sharding/Shard.js":!1,"src/sharding/ShardClientUtil.js":!1,"src/sharding/ShardingManager.js":!1,"src/client/voice/dispatcher/StreamDispatcher.js":!1,"src/client/voice/opus/BaseOpusEngine.js":!1,"src/client/voice/opus/NodeOpusEngine.js":!1,"src/client/voice/opus/OpusEngineList.js":!1,"src/client/voice/opus/OpusScriptEngine.js":!1,"src/client/voice/pcm/ConverterEngine.js":!1,"src/client/voice/pcm/ConverterEngineList.js":!1,"src/client/voice/pcm/FfmpegConverterEngine.js":!1,"src/client/voice/player/AudioPlayer.js":!1,"src/client/voice/receiver/VoiceReadable.js":!1,"src/client/voice/receiver/VoiceReceiver.js":!1,"src/client/voice/util/Secretbox.js":!1,"src/client/voice/util/SecretKey.js":!1,"src/client/voice/util/VolumeInterface.js":!1,"src/client/voice/ClientVoiceManager.js":!1,"src/client/voice/VoiceBroadcast.js":!1,"src/client/voice/VoiceConnection.js":!1,"src/client/voice/VoiceUDPClient.js":!1,"src/client/voice/VoiceWebSocket.js":!1}}},function(e,t,n){const i=n(16),s=n(3),r=n(40);class o extends i{setup(e){super.setup(e),this.verified=e.verified,this.email=e.email,this.localPresence={},this._typing=new Map,this.friends=new s,this.blocked=new s,this.notes=new s,this.premium="boolean"==typeof e.premium?e.premium:null,this.mfaEnabled="boolean"==typeof e.mfa_enabled?e.mfa_enabled:null,this.mobile="boolean"==typeof e.mobile?e.mobile:null,e.user_settings&&(this.settings=new r(this,e.user_settings))}edit(e){return this.client.rest.methods.updateCurrentUser(e)}setUsername(e,t){return this.client.rest.methods.updateCurrentUser({username:e},t)}setEmail(e,t){return this.client.rest.methods.updateCurrentUser({email:e},t)}setPassword(e,t){return this.client.rest.methods.updateCurrentUser({password:e},t)}setAvatar(e){return"string"==typeof e&&e.startsWith("data:")?this.client.rest.methods.updateCurrentUser({avatar:e}):this.client.resolver.resolveBuffer(e).then(e=>this.client.rest.methods.updateCurrentUser({avatar:e}))}setPresence(e){return new Promise(t=>{let n=this.localPresence.status||this.presence.status;let i=this.localPresence.game;let s=this.localPresence.afk||this.presence.afk;!i&&this.presence.game&&(i={name:this.presence.game.name,type:this.presence.game.type,url:this.presence.game.url});if(e.status){if("string"!=typeof e.status)throw new TypeError("Status must be a string");n=e.status}e.game?(i=e.game,i.url&&(i.type=1)):void 0!==e.game&&(i=null);void 0!==e.afk&&(s=e.afk);s=Boolean(s);this.localPresence={status:n,game:i,afk:s};this.localPresence.since=0;this.localPresence.game=this.localPresence.game||null;this.client.ws.send({op:3,d:this.localPresence});this.client._setPresence(this.id,this.localPresence);t(this)})}setStatus(e){return this.setPresence({status:e})}setGame(e,t){return e?this.setPresence({game:{name:e,url:t}}):this.setPresence({game:null})}setAFK(e){return this.setPresence({afk:e})}fetchMentions(e={limit:25,roles:!0,everyone:!0,guild:null}){return this.client.rest.methods.fetchMentions(e)}addFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.addFriend(e)}removeFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.removeFriend(e)}createGuild(e,t,n=null){return n?"string"==typeof n&&n.startsWith("data:")?this.client.rest.methods.createGuild({name:e,icon:n,region:t}):this.client.resolver.resolveBuffer(n).then(n=>this.client.rest.methods.createGuild({name:e,icon:n,region:t})):this.client.rest.methods.createGuild({name:e,icon:n,region:t})}createGroupDM(e){return this.client.rest.methods.createGroupDM({recipients:e.map(e=>this.client.resolver.resolveUserID(e.user)),accessTokens:e.map(e=>e.accessToken),nicks:e.map(e=>e.nick)})}acceptInvite(e){return this.client.rest.methods.acceptInvite(e)}}e.exports=o},function(e,t,n){const i=n(0),s=n(4);class r{constructor(e,t){this.user=e,this.patch(t)}patch(e){for(const t of Object.keys(i.UserSettingsMap)){const n=i.UserSettingsMap[t];e.hasOwnProperty(t)&&("function"==typeof n?this[n.name]=n(e[t]):this[n]=e[t])}}update(e,t){return this.user.client.rest.methods.patchUserSettings({[e]:t})}setGuildPosition(e,t,n){const i=Object.assign([],this.guildPositions);return s.moveElementInArray(i,e.id,t,n),this.update("guild_positions",i).then(()=>e)}addRestrictedGuild(e){const t=Object.assign([],this.restrictedGuilds);return t.includes(e.id)?Promise.reject(new Error("Guild is already restricted")):(t.push(e.id),this.update("restricted_guilds",t).then(()=>e))}removeRestrictedGuild(e){const t=Object.assign([],this.restrictedGuilds),n=t.indexOf(e.id);return n<0?Promise.reject(new Error("Guild is not restricted")):(t.splice(n,1),this.update("restricted_guilds",t).then(()=>e))}}e.exports=r},function(e,t,n){const i=n(14),s=n(22),r=n(3);class o extends i{constructor(e,t){super(e,t),this.type="dm",this.messages=new r,this._typing=new Map}setup(e){super.setup(e),this.recipient=this.client.dataManager.newUser(e.recipients[0]),this.lastMessageID=e.last_message_id}toString(){return this.recipient.toString()}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"]),e.exports=o},function(e,t,n){const i=n(49),s=n(50),r=n(0);class o{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.guild=this.client.guilds.get(e.guild.id)||new i(this.client,e.guild),this.code=e.code,this.temporary=e.temporary,this.maxAge=e.max_age,this.uses=e.uses,this.maxUses=e.max_uses,e.inviter&&(this.inviter=this.client.dataManager.newUser(e.inviter)),this.channel=this.client.channels.get(e.channel.id)||new s(this.client,e.channel),this.createdTimestamp=new Date(e.created_at).getTime()}get createdAt(){return new Date(this.createdTimestamp)}get expiresTimestamp(){return this.createdTimestamp+1e3*this.maxAge}get expiresAt(){return new Date(this.expiresTimestamp)}get url(){return r.Endpoints.inviteLink(this.code)}delete(){return this.client.rest.methods.deleteInvite(this)}toString(){return this.url}}e.exports=o},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"client",{value:e.client}),this.message=e,this.setup(t)}setup(e){this.id=e.id,this.filename=e.filename,this.filesize=e.size,this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}e.exports=n},function(e,t,n){const i=n(66);class s extends i{constructor(e,t,n={}){super(e.client,t,n),this.channel=e,this.received=0,this.client.on("message",this.listener),this.options.max&&(this.options.maxProcessed=this.options.max),this.options.maxMatches&&(this.options.max=this.options.maxMatches),this._reEmitter=(e=>{this.emit("message",e)}),this.on("collect",this._reEmitter)}handle(e){return e.channel.id!==this.channel.id?null:(this.received++,{key:e.id,value:e})}postCheck(){return this.options.maxMatches&&this.collected.size>=this.options.max?"matchesLimit":this.options.max&&this.received>=this.options.maxProcessed?"limit":null}cleanup(){this.removeListener("collect",this._reEmitter),this.client.removeListener("message",this.listener)}}e.exports=s},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"client",{value:e.client}),this.message=e,this.setup(t)}setup(e){if(this.type=e.type,this.title=e.title,this.description=e.description,this.url=e.url,this.color=e.color,this.fields=[],e.fields)for(const t of e.fields)this.fields.push(new c(this,t));this.createdTimestamp=e.timestamp,this.thumbnail=e.thumbnail?new i(this,e.thumbnail):null,this.image=e.image?new s(this,e.image):null,this.video=e.video?new r(this,e.video):null,this.author=e.author?new a(this,e.author):null,this.provider=e.provider?new o(this,e.provider):null,this.footer=e.footer?new u(this,e.footer):null}get createdAt(){return new Date(this.createdTimestamp)}get hexColor(){let e=this.color.toString(16);for(;e.length<6;)e=`0${e}`;return`#${e}`}}class i{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}class s{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}class r{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.height=e.height,this.width=e.width}}class o{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url}}class a{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url,this.iconURL=e.icon_url}}class c{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.value=e.value,this.inline=e.inline}}class u{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.text=e.text,this.iconURL=e.icon_url,this.proxyIconUrl=e.proxy_icon_url}}n.Thumbnail=i,n.Image=s,n.Video=r,n.Provider=o,n.Author=a,n.Field=c,n.Footer=u,e.exports=n},function(e,t,n){const i=n(3);class s{constructor(e,t,n,s){if(this.everyone=Boolean(s),t)if(t instanceof i)this.users=new i(t);else{this.users=new i;for(const n of t){let t=e.client.users.get(n.id);t||(t=e.client.dataManager.newUser(n)),this.users.set(t.id,t)}}else this.users=new i;if(n)if(n instanceof i)this.roles=new i(n);else{this.roles=new i;for(const t of n){const n=e.channel.guild.roles.get(t);n&&this.roles.set(n.id,n)}}else this.roles=new i;this._content=e.content,this._guild=e.channel.guild,this._members=null,this._channels=null}get members(){return this._members?this._members:this._guild?(this._members=new i,this.users.forEach(e=>{const t=this._guild.member(e);t&&this._members.set(t.user.id,t)}),this._members):null}get channels(){if(this._channels)return this._channels;if(!this._guild)return null;this._channels=new i;let e;for(;null!==(e=this.constructor.CHANNELS_PATTERN.exec(this._content));){const t=this._guild.channels.get(e[1]);t&&this._channels.set(t.id,t)}return this._channels}}s.EVERYONE_PATTERN=/@(everyone|here)/g,s.USERS_PATTERN=/<@!?[0-9]+>/g,s.ROLES_PATTERN=/<@&[0-9]+>/g,s.CHANNELS_PATTERN=/<#([0-9]+)>/g,e.exports=s},function(e,t,n){const i=n(3),s=n(17),r=n(29);class o{constructor(e,t,n,s){this.message=e,this.me=s,this.count=n||0,this.users=new i,this._emoji=new r(this,t.name,t.id)}get emoji(){if(this._emoji instanceof s)return this._emoji;if(this._emoji.id){const e=this.message.client.emojis;if(e.has(this._emoji.id)){const t=e.get(this._emoji.id);return this._emoji=t,t}}return this._emoji}remove(e=this.message.client.user){const t=this.message,n=this.message.client.resolver.resolveUserID(e);return n?t.client.rest.methods.removeMessageReaction(t,this.emoji.identifier,n):Promise.reject(new Error("Couldn't resolve the user ID to remove from the reaction."))}fetchUsers(e=100){const t=this.message;return t.client.rest.methods.getMessageReactionUsers(t,this.emoji.identifier,e).then(e=>{this.users=new i;for(const t of e){const e=this.message.client.dataManager.newUser(t);this.users.set(e.id,e)}this.count=this.users.size;return this.users})}}e.exports=o},function(e,t,n){const i=n(7);class s{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.description=e.description,this.icon=e.icon,this.iconURL=`https://cdn.discordapp.com/app-icons/${this.id}/${this.icon}.jpg`,this.rpcOrigins=e.rpc_origins,this.redirectURIs=e.redirect_uris,this.botRequireCodeGrant=e.bot_require_code_grant,this.botPublic=e.bot_public,this.rpcApplicationState=e.rpc_application_state,this.bot=e.bot,this.flags=e.flags,this.secret=e.secret}get createdTimestamp(){return i.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}reset(){return this.client.rest.methods.resetApplication(this.id)}toString(){return this.name}}e.exports=s},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.icon=e.icon,this.splash=e.splash}}e.exports=n},function(e,t,n){const i=n(0);class s{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.type=i.ChannelTypes.TEXT===e.type?"text":"voice"}}e.exports=s},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"channel",{value:e}),t&&this.setup(t)}setup(e){this.id=e.id,this.type=e.type,this.deny=e.deny,this.allow=e.allow}delete(){return this.channel.client.rest.methods.deletePermissionOverwrites(this)}}e.exports=n},function(e,t,n){const i=n(25),s=n(22),r=n(3);class o extends i{constructor(e,t){super(e,t),this.type="text",this.messages=new r,this._typing=new Map}setup(e){super.setup(e),this.topic=e.topic,this.lastMessageID=e.last_message_id}get members(){const e=new r;for(const t of this.guild.members.values())this.permissionsFor(t).hasPermission("READ_MESSAGES")&&e.set(t.id,t);return e}fetchWebhooks(){return this.client.rest.methods.getChannelWebhooks(this)}createWebhook(e,t){return new Promise(n=>{"string"==typeof t&&t.startsWith("data:")?n(this.client.rest.methods.createWebhook(this,e,t)):this.client.resolver.resolveBuffer(t).then(t=>n(this.client.rest.methods.createWebhook(this,e,t)))})}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendFiles(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}createMessageCollector(){}awaitMessages(){}bulkDelete(){}acknowledge(){}_cacheMessage(){}}s.applyToClass(o,!0),e.exports=o},function(e,t,n){const i=n(25),s=n(3);class r extends i{constructor(e,t){super(e,t),this.members=new s,this.type="voice"}setup(e){super.setup(e),this.bitrate=e.bitrate,this.userLimit=e.user_limit}get connection(){const e=this.guild.voiceConnection;return e&&e.channel.id===this.id?e:null}get full(){return this.userLimit>0&&this.members.size>=this.userLimit}get joinable(){return!this.client.browser&&(!!this.permissionsFor(this.client.user).hasPermission("CONNECT")&&!(this.full&&!this.permissionsFor(this.client.user).hasPermission("MOVE_MEMBERS")))}get speakable(){return this.permissionsFor(this.client.user).hasPermission("SPEAK")}setBitrate(e){return this.edit({bitrate:e})}setUserLimit(e){return this.edit({userLimit:e})}join(){return this.client.browser?Promise.reject(new Error("Voice connections are not available in browsers.")):this.client.voice.joinChannel(this)}leave(){if(!this.client.browser){const e=this.client.voice.connections.get(this.guild.id);e&&e.channel.id===this.id&&e.disconnect()}}}e.exports=r},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(t){function i(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?M(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function s(e,t){S=S||n(13),e=e||{},this.objectMode=!!e.objectMode,t instanceof S&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:s,this.highWaterMark=~~this.highWaterMark,this.buffer=new G,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(P||(P=n(62).StringDecoder),this.decoder=new P(e.encoding),this.encoding=e.encoding)}function r(e){if(S=S||n(13),!(this instanceof r))return new r(e);this._readableState=new s(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),I.call(this)}function o(e,t,n,i,s){var r=l(t,n);if(r)e.emit("error",r);else if(null===n)t.reading=!1,h(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!s){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&s){var c=new Error("stream.unshift() after end event");e.emit("error",c)}else{var u;!t.decoder||s||i||(n=t.decoder.write(n),u=!t.objectMode&&0===n.length),s||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,s?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&p(e))),f(e,t)}else s||(t.reading=!1);return a(t)}function a(e){return!e.ended&&(e.needReadable||e.length=B?e=B:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function u(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=c(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function l(e,t){var n=null;return U.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function h(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,p(e)}}function p(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(j("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?D(d,e):d(e))}function d(e){j("emit readable"),e.emit("readable"),w(e)}function f(e,t){t.readingMore||(t.readingMore=!0,D(m,e,t))}function m(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=_(e,t.buffer,t.decoder),n}function _(e,t,n){var i;return er.length?r.length:e;if(o===r.length?s+=r:s+=r.slice(0,e),0===(e-=o)){o===r.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=r.slice(o));break}++i}return t.length-=i,s}function R(e,t){var n=L.allocUnsafe(e),i=t.head,s=1;for(i.data.copy(n),e-=i.data.length;i=i.next;){var r=i.data,o=e>r.length?r.length:e;if(r.copy(n,n.length-e,0,o),0===(e-=o)){o===r.length?(++s,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=r.slice(o));break}++s}return t.length-=s,n}function A(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,D(k,t,e))}function k(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function T(e,t){for(var n=0,i=e.length;n=t.highWaterMark||t.ended))return j("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?A(this):p(this),null;if(0===(e=u(e,t))&&t.ended)return 0===t.length&&A(this),null;var i=t.needReadable;j("need readable",i),(0===t.length||t.length-e0?y(e,t):null,null===s?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&A(this)),null!==s&&this.emit("data",s),s},r.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},r.prototype.pipe=function(e,n){function s(e){j("onunpipe"),e===p&&o()}function r(){j("onend"),e.end()}function o(){j("cleanup"),e.removeListener("close",u),e.removeListener("finish",l),e.removeListener("drain",v),e.removeListener("error",c),e.removeListener("unpipe",s),p.removeListener("end",r),p.removeListener("end",o),p.removeListener("data",a),b=!0,!d.awaitDrain||e._writableState&&!e._writableState.needDrain||v()}function a(t){j("ondata"),E=!1,!1!==e.write(t)||E||((1===d.pipesCount&&d.pipes===e||d.pipesCount>1&&-1!==T(d.pipes,e))&&!b&&(j("false write response, pause",p._readableState.awaitDrain),p._readableState.awaitDrain++,E=!0),p.pause())}function c(t){j("onerror",t),h(),e.removeListener("error",c),0===C(e,"error")&&e.emit("error",t)}function u(){e.removeListener("finish",l),h()}function l(){j("onfinish"),e.removeListener("close",u),h()}function h(){j("unpipe"),p.unpipe(e)}var p=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,j("pipe count=%d opts=%j",d.pipesCount,n);var f=(!n||!1!==n.end)&&e!==t.stdout&&e!==t.stderr,m=f?r:o;d.endEmitted?D(m):p.once("end",m),e.on("unpipe",s);var v=g(p);e.on("drain",v);var b=!1,E=!1;return p.on("data",a),i(e,"error",c),e.once("close",u),e.once("finish",l),e.emit("pipe",p),d.flowing||(j("pipe resume"),p.resume()),e},r.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s",'"',"`"," ","\r","\n","\t"],f=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(f),g=["%","/","?",";","#"].concat(m),v=["/","?","#"],b={javascript:!0,"javascript:":!0},E={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(34);i.prototype.parse=function(e,t,n){if(!u.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i127?C+="x":C+=M[I];if(!C.match(/^[+a-z0-9A-Z_-]{0,63}$/)){var L=S.slice(0,x),O=S.slice(x+1),N=M.match(/^([+a-z0-9A-Z_-]{0,63})(.*)$/);N&&(L.push(N[1]),O.unshift(N[2])),O.length&&(o="/"+O.join(".")+o),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=c.toASCII(this.hostname));var j=this.port?":"+this.port:"",P=this.hostname||"";this.host=P+j,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!b[d])for(var x=0,D=m.length;x0)&&n.host.split("@");A&&(n.auth=A.shift(),n.host=n.hostname=A.shift())}return n.search=e.search,n.query=e.query,u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var k=x.slice(-1)[0],T=(n.host||e.host||x.length>1)&&("."===k||".."===k)||""===k,S=0,D=x.length;D>=0;D--)k=x[D],"."===k?x.splice(D,1):".."===k?(x.splice(D,1),S++):S&&(x.splice(D,1),S--);if(!y&&!_)for(;S--;S)x.unshift("..");!y||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),T&&"/"!==x.join("/").substr(-1)&&x.push("");var M=""===x[0]||x[0]&&"/"===x[0].charAt(0);if(R){n.hostname=n.host=M?"":x.length?x.shift():"";var A=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");A&&(n.auth=A.shift(),n.host=n.hostname=A.shift())}return y=y||n.host&&x.length,y&&!M&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=h.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){function i(e){if(e&&!c(e))throw new Error("Unknown encoding: "+e)}function s(e){return e.toString(this.encoding)}function r(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function o(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var a=n(5).Buffer,c=a.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},u=t.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),i(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=r;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=o;break;default:return void(this.write=s)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};u.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var s=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,s),s-=this.charReceived),t+=e.toString(this.encoding,0,s);var s=t.length-1,i=t.charCodeAt(s);if(i>=55296&&i<=56319){var r=this.surrogateSize;return this.charLength+=r,this.charReceived+=r,this.charBuffer.copy(this.charBuffer,r,0,r),e.copy(this.charBuffer,0,0,r),t.substring(0,s)}return t},u.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},u.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,i=this.charBuffer,s=this.encoding;t+=i.slice(0,n).toString(s)}return t}},function(e,t,n){const i=n(139),s=n(136),r=n(138),o=n(137),a=n(135),c=n(0);class u{constructor(e){this.client=e,this.handlers={},this.userAgentManager=new i(this),this.methods=new s(this),this.rateLimitedEndpoints={},this.globallyRateLimited=!1}push(e,t){return new Promise((n,i)=>{e.push({request:t,resolve:n,reject:i})})}getRequestHandler(){switch(this.client.options.apiRequestMethod){case"sequential":return r;case"burst":return o;default:throw new Error(c.Errors.INVALID_RATE_LIMIT_METHOD)}}makeRequest(e,t,n,i,s){const r=new a(this,e,t,n,i,s);if(!this.handlers[r.route]){const e=this.getRequestHandler();this.handlers[r.route]=new e(this,r.route)}return this.push(this.handlers[r.route],r)}}e.exports=u},function(e,t){class n{constructor(e){this.restManager=e,this.queue=[]}get globalLimit(){return this.restManager.globallyRateLimited}set globalLimit(e){this.restManager.globallyRateLimited=e}push(e){this.queue.push(e)}handle(){}}e.exports=n},function(e,t,n){(function(t){const i="browser"===n(23).platform(),s=n(12),r=n(27),o=function(){try{const e=n(187);return e.pack?e:null}catch(e){return null}}(),a=function(){if(i)return window.WebSocket;try{return n(188)}catch(e){return n(189)}}();class c extends s{constructor(e){super(e),this.ws=new a(e),i&&(this.ws.binaryType="arraybuffer"),this.ws.onmessage=this.eventMessage.bind(this),this.ws.onopen=this.emit.bind(this,"open"),this.ws.onclose=this.emit.bind(this,"close"),this.ws.onerror=this.emit.bind(this,"error")}eventMessage(e){try{const t=this.unpack(e.data);return this.emit("packet",t),!0}catch(e){return this.listenerCount("decodeError")&&this.emit("decodeError",e),!1}}send(e){this.ws.send(this.pack(e))}pack(e){return o?o.pack(e):JSON.stringify(e)}unpack(e){return o&&"string"!=typeof e?(e instanceof ArrayBuffer&&(e=t.from(new Uint8Array(e))),o.unpack(e)):((e instanceof ArrayBuffer||e instanceof t)&&(e=this.inflate(e)),JSON.parse(e))}inflate(e){return o?e:r.inflateSync(e).toString()}get readyState(){return this.ws.readyState}close(e,t){this.ws.close(e,t)}}c.ENCODING=o?"etf":"json",c.WebSocket=a,e.exports=c}).call(t,n(5).Buffer)},function(e,t,n){const i=n(3),s=n(12).EventEmitter;class r extends s{constructor(e,t,n={}){super(),this.client=e,this.filter=t,this.options=n,this.collected=new i,this.ended=!1,this._timeout=null,this.listener=this._handle.bind(this),n.time&&(this._timeout=this.client.setTimeout(()=>this.stop("time"),n.time))}_handle(...e){const t=this.handle(...e);if(t&&this.filter(...e)){this.collected.set(t.key,t.value),this.emit("collect",t.value,this);const n=this.postCheck(...e);n&&this.stop(n)}}get next(){return new Promise((e,t)=>{if(this.ended)return void t(this.collected);const n=()=>{this.removeListener("collect",i);this.removeListener("end",s)};const i=t=>{n();e(t)};const s=()=>{n();t(this.collected)};this.on("collect",i);this.on("end",s)})}stop(e="user"){this.ended||(this._timeout&&this.client.clearTimeout(this._timeout),this.ended=!0,this.cleanup(),this.emit("end",this.collected,e))}handle(){}postCheck(){}cleanup(){}}e.exports=r},function(module,exports,__webpack_require__){(function(process){const os=__webpack_require__(23),EventEmitter=__webpack_require__(12).EventEmitter,Constants=__webpack_require__(0),Permissions=__webpack_require__(9),Util=__webpack_require__(4),RESTManager=__webpack_require__(63),ClientDataManager=__webpack_require__(104),ClientManager=__webpack_require__(105),ClientDataResolver=__webpack_require__(37),ClientVoiceManager=__webpack_require__(185),WebSocketManager=__webpack_require__(140),ActionsManager=__webpack_require__(106),Collection=__webpack_require__(3),Presence=__webpack_require__(11).Presence,ShardClientUtil=__webpack_require__(184),VoiceBroadcast=__webpack_require__(186);class Client extends EventEmitter{constructor(e={}){super(),!e.shardId&&"SHARD_ID"in process.env&&(e.shardId=Number(process.env.SHARD_ID)),!e.shardCount&&"SHARD_COUNT"in process.env&&(e.shardCount=Number(process.env.SHARD_COUNT)),this.options=Util.mergeDefault(Constants.DefaultOptions,e),this._validateOptions(),this.rest=new RESTManager(this),this.dataManager=new ClientDataManager(this),this.manager=new ClientManager(this),this.ws=new WebSocketManager(this),this.resolver=new ClientDataResolver(this),this.actions=new ActionsManager(this),this.voice=this.browser?null:new ClientVoiceManager(this),this.shard=process.send?ShardClientUtil.singleton(this):null,this.users=new Collection,this.guilds=new Collection,this.channels=new Collection,this.presences=new Collection,!this.token&&"CLIENT_TOKEN"in process.env?this.token=process.env.CLIENT_TOKEN:this.token=null,this.user=null,this.readyAt=null,this.broadcasts=[],this.pings=[],this._pingTimestamp=0,this._timeouts=new Set,this._intervals=new Set,this.options.messageSweepInterval>0&&this.setInterval(this.sweepMessages.bind(this),1e3*this.options.messageSweepInterval)}get status(){return this.ws.status}get uptime(){return this.readyAt?Date.now()-this.readyAt:null}get ping(){return this.pings.reduce((e,t)=>e+t,0)/this.pings.length}get voiceConnections(){return this.browser?new Collection:this.voice.connections}get emojis(){const e=new Collection;for(const t of this.guilds.values())for(const n of t.emojis.values())e.set(n.id,n);return e}get readyTimestamp(){return this.readyAt?this.readyAt.getTime():null}get browser(){return"browser"===os.platform()}createVoiceBroadcast(){const e=new VoiceBroadcast(this);return this.broadcasts.push(e),e}login(e){return this.rest.methods.login(e)}destroy(){for(const e of this._timeouts)clearTimeout(e);for(const e of this._intervals)clearInterval(e);return this._timeouts.clear(),this._intervals.clear(),this.manager.destroy()}syncGuilds(e=this.guilds){this.user.bot||this.ws.send({op:12,d:e instanceof Collection?e.keyArray():e.map(e=>e.id)})}fetchUser(e,t=!0){return this.users.has(e)?Promise.resolve(this.users.get(e)):this.rest.methods.getUser(e,t)}fetchInvite(e){const t=this.resolver.resolveInviteCode(e);return this.rest.methods.getInvite(t)}fetchWebhook(e,t){return this.rest.methods.getWebhook(e,t)}fetchVoiceRegions(){return this.rest.methods.fetchVoiceRegions()}sweepMessages(e=this.options.messageCacheLifetime){if("number"!=typeof e||isNaN(e))throw new TypeError("The lifetime must be a number.");if(e<=0)return this.emit("debug","Didn't sweep messages - lifetime is unlimited"),-1;const t=1e3*e,n=Date.now();let i=0,s=0;for(const e of this.channels.values())if(e.messages){i++;for(const i of e.messages.values())n-(i.editedTimestamp||i.createdTimestamp)>t&&(e.messages.delete(i.id),s++)}return this.emit("debug",`Swept ${s} messages older than ${e} seconds in ${i} text-based channels`),s}fetchApplication(e="@me"){return this.rest.methods.getApplication(e)}generateInvite(e){return e?e instanceof Array&&(e=Permissions.resolve(e)):e=0,this.fetchApplication().then(t=>`https://discordapp.com/oauth2/authorize?client_id=${t.id}&permissions=${e}&scope=bot`)}setTimeout(e,t,...n){const i=setTimeout(()=>{e();this._timeouts.delete(i)},t,...n);return this._timeouts.add(i),i}clearTimeout(e){clearTimeout(e),this._timeouts.delete(e)}setInterval(e,t,...n){const i=setInterval(e,t,...n);return this._intervals.add(i),i}clearInterval(e){clearInterval(e),this._intervals.delete(e)}_pong(e){this.pings.unshift(Date.now()-e),this.pings.length>3&&(this.pings.length=3),this.ws.lastHeartbeatAck=!0}_setPresence(e,t){if(this.presences.has(e))return void this.presences.get(e).update(t);this.presences.set(e,new Presence(t))}_eval(script){return eval(script)}_validateOptions(e=this.options){if("number"!=typeof e.shardCount||isNaN(e.shardCount))throw new TypeError("The shardCount option must be a number.");if("number"!=typeof e.shardId||isNaN(e.shardId))throw new TypeError("The shardId option must be a number.");if(e.shardCount<0)throw new RangeError("The shardCount option must be at least 0.");if(e.shardId<0)throw new RangeError("The shardId option must be at least 0.");if(0!==e.shardId&&e.shardId>=e.shardCount)throw new RangeError("The shardId option must be less than shardCount.");if("number"!=typeof e.messageCacheMaxSize||isNaN(e.messageCacheMaxSize))throw new TypeError("The messageCacheMaxSize option must be a number.");if("number"!=typeof e.messageCacheLifetime||isNaN(e.messageCacheLifetime))throw new TypeError("The messageCacheLifetime option must be a number.");if("number"!=typeof e.messageSweepInterval||isNaN(e.messageSweepInterval))throw new TypeError("The messageSweepInterval option must be a number.");if("boolean"!=typeof e.fetchAllMembers)throw new TypeError("The fetchAllMembers option must be a boolean.");if("boolean"!=typeof e.disableEveryone)throw new TypeError("The disableEveryone option must be a boolean.");if("number"!=typeof e.restWsBridgeTimeout||isNaN(e.restWsBridgeTimeout))throw new TypeError("The restWsBridgeTimeout option must be a number.");if(!(e.disabledEvents instanceof Array))throw new TypeError("The disabledEvents option must be an Array.")}}module.exports=Client}).call(exports,__webpack_require__(6))},function(e,t,n){const i=n(30),s=n(63),r=n(37),o=n(0),a=n(4);class c extends i{constructor(e,t,n){super(null,e,t),this.options=a.mergeDefault(o.DefaultOptions,n),this.rest=new s(this),this.resolver=new r(this),this._timeouts=new Set,this._intervals=new Set}setTimeout(e,t,...n){const i=setTimeout(()=>{e();this._timeouts.delete(i)},t,...n);return this._timeouts.add(i),i}clearTimeout(e){clearTimeout(e),this._timeouts.delete(e)}setInterval(e,t,...n){const i=setInterval(e,t,...n);return this._intervals.add(i),i}clearInterval(e){clearInterval(e),this._intervals.delete(e)}destroy(){for(const e of this._timeouts)clearTimeout(e);for(const e of this._intervals)clearInterval(e);this._timeouts.clear(),this._intervals.clear()}}e.exports=c},function(e,t,n){function i(e){return"string"==typeof e?e:e instanceof Array?e.join("\n"):String(e)}const s=n(37);class r{constructor(e={}){this.title=e.title,this.description=e.description,this.url=e.url,this.color=e.color,this.author=e.author,this.timestamp=e.timestamp,this.fields=e.fields||[],this.thumbnail=e.thumbnail,this.image=e.image,this.footer=e.footer,this.file=e.file}setTitle(e){if(e=i(e),e.length>256)throw new RangeError("RichEmbed titles may not exceed 256 characters.");return this.title=e,this}setDescription(e){if(e=i(e),e.length>2048)throw new RangeError("RichEmbed descriptions may not exceed 2048 characters.");return this.description=e,this}setURL(e){return this.url=e,this}setColor(e){return this.color=s.resolveColor(e),this}setAuthor(e,t,n){return this.author={name:i(e),icon_url:t,url:n},this}setTimestamp(e=new Date){return this.timestamp=e,this}addField(e,t,n=!1){if(this.fields.length>=25)throw new RangeError("RichEmbeds may not exceed 25 fields.");if(e=i(e),e.length>256)throw new RangeError("RichEmbed field names may not exceed 256 characters.");if(!/\S/.test(e))throw new RangeError("RichEmbed field names may not be empty.");if(t=i(t),t.length>1024)throw new RangeError("RichEmbed field values may not exceed 1024 characters.");if(!/\S/.test(t))throw new RangeError("RichEmbed field values may not be empty.");return this.fields.push({name:e,value:t,inline:n}),this}addBlankField(e=!1){return this.addField("​","​",e)}setThumbnail(e){return this.thumbnail={url:e},this}setImage(e){return this.image={url:e},this}setFooter(e,t){if(e=i(e),e.length>2048)throw new RangeError("RichEmbed footer text may not exceed 2048 characters.");return this.footer={text:e,icon_url:t},this}attachFile(e){if(this.file)throw new RangeError("You may not upload more than one file at once.");return this.file=e,this}}e.exports=r},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";function i(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function s(e){return 3*e.length/4-i(e)}function r(e){var t,n,s,r,o,a,c=e.length;o=i(e),a=new h(3*c/4-o),s=o>0?c-4:c;var u=0;for(t=0,n=0;t>16&255,a[u++]=r>>8&255,a[u++]=255&r;return 2===o?(r=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,a[u++]=255&r):1===o&&(r=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,a[u++]=r>>8&255,a[u++]=255&r),a}function o(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function a(e,t,n){for(var i,s=[],r=t;rc?c:o+16383));return 1===i?(t=e[n-1],s+=u[t>>2],s+=u[t<<4&63],s+="=="):2===i&&(t=(e[n-2]<<8)+e[n-1],s+=u[t>>10],s+=u[t>>4&63],s+=u[t<<2&63],s+="="),r.push(s),r.join("")}t.byteLength=s,t.toByteArray=r,t.fromByteArray=c;for(var u=[],l=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,f=p.length;d>1,l=-7,h=n?s-1:0,p=n?-1:1,d=e[t+h];for(h+=p,r=d&(1<<-l)-1,d>>=-l,l+=a;l>0;r=256*r+e[t+h],h+=p,l-=8);for(o=r&(1<<-l)-1,r>>=-l,l+=i;l>0;o=256*o+e[t+h],h+=p,l-=8);if(0===r)r=1-u;else{if(r===c)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,i),r-=u}return(d?-1:1)*o*Math.pow(2,r-i)},t.write=function(e,t,n,i,s,r){var o,a,c,u=8*r-s-1,l=(1<>1,p=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:r-1,f=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),t+=o+h>=1?p/c:p*Math.pow(2,1-h),t*c>=2&&(o++,c/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(t*c-1)*Math.pow(2,s),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,s),o=0));s>=8;e[n+d]=255&a,d+=f,a/=256,s-=8);for(o=o<0;e[n+d]=255&o,d+=f,o/=256,u-=8);e[n+d-f]|=128*m}},function(e,t,n){(function(e,i){var s;!function(r){function o(e){throw new RangeError(I[e])}function a(e,t){for(var n=e.length,i=[];n--;)i[n]=t(e[n]);return i}function c(e,t){var n=e.split("@"),i="";return n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(C,"."),i+a(e.split("."),t).join(".")}function u(e){for(var t,n,i=[],s=0,r=e.length;s=55296&&t<=56319&&s65535&&(e-=65536,t+=O(e>>>10&1023|55296),e=56320|1023&e),t+=O(e)}).join("")}function h(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:y}function p(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function d(e,t,n){var i=0;for(e=n?L(e/A):e>>1,e+=L(e/t);e>U*x>>1;i+=y)e=L(e/U);return L(i+(U+1)*e/(e+R))}function f(e){var t,n,i,s,r,a,c,u,p,f,m=[],g=e.length,v=0,b=T,E=k;for(n=e.lastIndexOf(S),n<0&&(n=0),i=0;i=128&&o("not-basic"),m.push(e.charCodeAt(i));for(s=n>0?n+1:0;s=g&&o("invalid-input"),u=h(e.charCodeAt(s++)),(u>=y||u>L((w-v)/a))&&o("overflow"),v+=u*a,p=c<=E?_:c>=E+x?x:c-E,!(uL(w/f)&&o("overflow"),a*=f;t=m.length+1,E=d(v-r,t,0==r),L(v/t)>w-b&&o("overflow"),b+=L(v/t),v%=t,m.splice(v++,0,b)}return l(m)}function m(e){var t,n,i,s,r,a,c,l,h,f,m,g,v,b,E,R=[];for(e=u(e),g=e.length,t=T,n=0,r=k,a=0;a=t&&mL((w-n)/v)&&o("overflow"),n+=(c-t)*v,t=c,a=0;aw&&o("overflow"),m==t){for(l=n,h=y;f=h<=r?_:h>=r+x?x:h-r,!(l= 0x80 (not a basic code point)","invalid-input":"Invalid input"},U=y-_,L=Math.floor,O=String.fromCharCode;E={version:"1.4.1",ucs2:{decode:u,encode:l},decode:f,encode:m,toASCII:v,toUnicode:g},void 0!==(s=function(){return E}.call(t,n,t,e))&&(e.exports=s)}()}).call(t,n(102)(e),n(8))},function(e,t,n){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,r){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;e=e.split(t);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var u=0;u=0?(l=f.substr(0,m),h=f.substr(m+1)):(l=f,h=""),p=decodeURIComponent(l),d=decodeURIComponent(h),i(o,p)?s(o[p])?o[p].push(d):o[p]=[o[p],d]:o[p]=d}return o};var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";function i(e,t){if(e.map)return e.map(t);for(var n=[],i=0;i0?this.tail.next=t:this.head=t,this.tail=t,++this.length},i.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},i.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},i.prototype.clear=function(){this.head=this.tail=null,this.length=0},i.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},i.prototype.concat=function(e){if(0===this.length)return s.alloc(0);if(1===this.length)return this.head.data;for(var t=s.allocUnsafe(e>>>0),n=this.head,i=0;n;)n.data.copy(t,i),i+=n.data.length,n=n.next;return t}},function(e,t,n){e.exports=n(21).PassThrough},function(e,t,n){e.exports=n(21).Transform},function(e,t,n){e.exports=n(35)},function(e,t,n){(function(e,t){!function(e,n){"use strict";function i(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n=3.1.0 <4.0.0",type:"range"},"/home/travis/build/hydrabolt/discord.js"]],_from:"snekfetch@>=3.1.0 <4.0.0",_id:"snekfetch@3.1.2",_inCache:!0,_location:"/snekfetch",_nodeVersion:"7.9.0",_npmOperationalInternal:{host:"packages-18-east.internal.npmjs.com",tmp:"tmp/snekfetch-3.1.2.tgz_1492882967312_0.8088863184675574"},_npmUser:{name:"crawl",email:"icrawltogo@gmail.com"},_npmVersion:"4.2.0",_phantomChildren:{},_requested:{raw:"snekfetch@^3.1.0",scope:null,escapedName:"snekfetch",name:"snekfetch",rawSpec:"^3.1.0",spec:">=3.1.0 <4.0.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.2.tgz",_shasum:"3422a9191c1bb6610867db88e669db0b5adb7f42",_shrinkwrap:null,_spec:"snekfetch@^3.1.0",_where:"/home/travis/build/hydrabolt/discord.js",author:{name:"Gus Caplan",email:"me@gus.host"},bugs:{url:"https://github.com/GusCaplan/snekfetch/issues"},dependencies:{},description:"Just do http requests without all that weird nastiness from other libs",devDependencies:{},directories:{},dist:{shasum:"3422a9191c1bb6610867db88e669db0b5adb7f42",tarball:"https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.2.tgz"},gitHead:"a79f6867d21ca58ffe6fc59eb77b06f257f8ad29",homepage:"https://github.com/GusCaplan/snekfetch#readme",license:"MIT",main:"index.js",maintainers:[{name:"crawl",email:"icrawltogo@gmail.com"},{name:"snek",email:"me@gus.host"}],name:"snekfetch",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/GusCaplan/snekfetch.git"},scripts:{},version:"3.1.2"}},function(e,t,n){(function(t){const i=n(26),s=n(90);class r{constructor(){this.boundary=`--snekfetch--${Math.random().toString().slice(2,7)}`,this.buffer=new t(0)}append(e,n,r){if(void 0!==n){let o=` +!function(n,o){s=[],i=o,void 0!==(r="function"==typeof i?i.apply(t,s):i)&&(e.exports=r)}(0,function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}function n(e,t){var n,i,r;return t?(e>>>=0,(r=0<=e&&e<256)&&(i=c[e])?i:(n=s(e,(0|e)<0?-1:0,!0),r&&(c[e]=n),n)):(e|=0,(r=-128<=e&&e<128)&&(i=a[e])?i:(n=s(e,e<0?-1:0,!1),r&&(a[e]=n),n))}function i(e,t){if(isNaN(e)||!isFinite(e))return t?m:f;if(t){if(e<0)return m;if(e>=h)return w}else{if(e<=-p)return y;if(e+1>=p)return E}return e<0?i(-e,t).neg():s(e%l|0,e/l|0,t)}function s(t,n,i){return new e(t,n,i)}function r(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return f;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===s)return r(e.substring(1),t,n).neg();for(var o=i(u(n,8)),a=f,c=0;c>>0:this.low},_.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},_.toString=function(e){if((e=e||10)<2||36>>0,h=l.toString(e);if(o=c,o.isZero())return h+a;for(;h.length<6;)h="0"+h;a=""+h+a}},_.getHighBits=function(){return this.high},_.getHighBitsUnsigned=function(){return this.high>>>0},_.getLowBits=function(){return this.low},_.getLowBitsUnsigned=function(){return this.low>>>0},_.getNumBitsAbs=function(){if(this.isNegative())return this.eq(y)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},_.isOdd=function(){return 1==(1&this.low)},_.isEven=function(){return 0==(1&this.low)},_.equals=function(e){return t(e)||(e=o(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},_.eq=_.equals,_.notEquals=function(e){return!this.eq(e)},_.neq=_.notEquals,_.lessThan=function(e){return this.comp(e)<0},_.lt=_.lessThan,_.lessThanOrEqual=function(e){return this.comp(e)<=0},_.lte=_.lessThanOrEqual,_.greaterThan=function(e){return this.comp(e)>0},_.gt=_.greaterThan,_.greaterThanOrEqual=function(e){return this.comp(e)>=0},_.gte=_.greaterThanOrEqual,_.compare=function(e){if(t(e)||(e=o(e)),this.eq(e))return 0;var n=this.isNegative(),i=e.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},_.comp=_.compare,_.negate=function(){return!this.unsigned&&this.eq(y)?y:this.not().add(g)},_.neg=_.negate,_.add=function(e){t(e)||(e=o(e));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,c=e.high>>>16,u=65535&e.high,l=e.low>>>16,h=65535&e.low,p=0,d=0,f=0,m=0;return m+=a+h,f+=m>>>16,m&=65535,f+=r+l,d+=f>>>16,f&=65535,d+=i+u,p+=d>>>16,d&=65535,p+=n+c,p&=65535,s(f<<16|m,p<<16|d,this.unsigned)},_.subtract=function(e){return t(e)||(e=o(e)),this.add(e.neg())},_.sub=_.subtract,_.multiply=function(e){if(this.isZero())return f;if(t(e)||(e=o(e)),e.isZero())return f;if(this.eq(y))return e.isOdd()?y:f;if(e.eq(y))return this.isOdd()?y:f;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return i(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,a=this.low>>>16,c=65535&this.low,u=e.high>>>16,l=65535&e.high,h=e.low>>>16,p=65535&e.low,m=0,g=0,v=0,b=0;return b+=c*p,v+=b>>>16,b&=65535,v+=a*p,g+=v>>>16,v&=65535,v+=c*h,g+=v>>>16,v&=65535,g+=r*p,m+=g>>>16,g&=65535,g+=a*h,m+=g>>>16,g&=65535,g+=c*l,m+=g>>>16,g&=65535,m+=n*p+r*h+a*l+c*u,m&=65535,s(v<<16|b,m<<16|g,this.unsigned)},_.mul=_.multiply,_.divide=function(e){if(t(e)||(e=o(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?m:f;var n,s,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return m;if(e.gt(this.shru(1)))return v;r=m}else{if(this.eq(y)){if(e.eq(g)||e.eq(b))return y;if(e.eq(y))return g;return n=this.shr(1).div(e).shl(1),n.eq(f)?e.isNegative()?g:b:(s=this.sub(e.mul(n)),r=n.add(s.div(e)))}if(e.eq(y))return this.unsigned?m:f;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=f}for(s=this;s.gte(e);){n=Math.max(1,Math.floor(s.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),c=a<=48?1:u(2,a-48),l=i(n),h=l.mul(e);h.isNegative()||h.gt(s);)n-=c,l=i(n,this.unsigned),h=l.mul(e);l.isZero()&&(l=g),r=r.add(l),s=s.sub(h)}return r},_.div=_.divide,_.modulo=function(e){return t(e)||(e=o(e)),this.sub(this.div(e).mul(e))},_.mod=_.modulo,_.not=function(){return s(~this.low,~this.high,this.unsigned)},_.and=function(e){return t(e)||(e=o(e)),s(this.low&e.low,this.high&e.high,this.unsigned)},_.or=function(e){return t(e)||(e=o(e)),s(this.low|e.low,this.high|e.high,this.unsigned)},_.xor=function(e){return t(e)||(e=o(e)),s(this.low^e.low,this.high^e.high,this.unsigned)},_.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?s(this.low<>>32-e,this.unsigned):s(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):s(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},_.shr=_.shiftRight,_.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0===(e&=63))return this;var n=this.high;if(e<32){return s(this.low>>>e|n<<32-e,n>>>e,this.unsigned)}return 32===e?s(n,0,this.unsigned):s(n>>>e-32,0,this.unsigned)},_.shru=_.shiftRightUnsigned,_.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},_.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},_.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},_.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},_.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})},function(e,t,n){"use strict";(function(t){function n(e,n,i,s){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var r,o,a=arguments.length;switch(a){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,i)});case 4:return t.nextTick(function(){e.call(null,n,i,s)});default:for(r=new Array(a-1),o=0;o-1?i:A;a.WritableState=o;var T=n(20);T.inherits=n(10);var S={deprecate:n(98)},D=n(57),M=n(5).Buffer,C=n(31);T.inherits(a,D),o.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(o.prototype,"buffer",{get:S.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var I;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(a,Symbol.hasInstance,{value:function(e){return!!I.call(this,e)||e&&e._writableState instanceof o}})):I=function(e){return e instanceof this},a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},a.prototype.write=function(e,t,n){var i=this._writableState,r=!1,o=M.isBuffer(e);return"function"==typeof t&&(n=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=s),i.ended?c(this,n):(o||u(this,i,e,n))&&(i.pendingcb++,r=h(this,i,o,e,t,n)),r},a.prototype.cork=function(){this._writableState.corked++},a.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||b(this,e))},a.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},a.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},a.prototype._writev=null,a.prototype.end=function(e,t,n){var i=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||_(this,i,n)}}).call(t,n(6),n(95).setImmediate)},function(e,t,n){(function(t,i,s){const r=n(89),o="__SNEKFETCH_SYNC_REQUEST";let a=!0;for(let e of r.METHODS)e="M-SEARCH"===e?"msearch":e.toLowerCase(),r[`${e}Sync`]=((s,r={})=>{a&&(a=!1,console.error("Performing sync requests is a really stupid thing to do. https://www.google.com/search?q=why+sync+requests+are+bad+nodejs"));r.url=s;r.method=e;const c=n(27);const u=JSON.parse(c.execSync(`node ${t}/index.js`,{env:{[o]:JSON.stringify(r)}}).toString(),(e,t)=>{if(null===t)return t;if("Buffer"===t.type&&Array.isArray(t.data))return new i(t.data);if(t.__CONVERT_TO_ERROR){const e=new Error;for(const n of Object.keys(t))"__CONVERT_TO_ERROR"!==n&&(e[n]=t[n]);return e}return t});if(u.error)throw u.error;return u});if(s.env[o]){const e=JSON.parse(s.env[o]),t=r[e.method](e.url);e.headers&&t.set(e.headers),e.body&&t.send(e.body),t.end((e,t={})=>{if(e){const n={};for(const t of Object.getOwnPropertyNames(e))n[t]=e[t];t.error=n,t.error.__CONVERT_TO_ERROR=!0}t.request=null;s.stdout.write(JSON.stringify(t))})}e.exports=r}).call(t,"node_modules/snekfetch",n(5).Buffer,n(6))},function(e,t,n){(function(t){const i=n(26),s=n(27),r=n(36),o=n(0),a=n(4).convertToBuffer,c=n(16),u=n(19),l=n(24),h=n(14),p=n(18),d=n(17),f=n(29);class m{constructor(e){this.client=e}resolveUser(e){return e instanceof c?e:"string"==typeof e?this.client.users.get(e)||null:e instanceof p?e.user:e instanceof u?e.author:e instanceof l?e.owner:null}resolveUserID(e){return e instanceof c||e instanceof p?e.id:"string"==typeof e?e||null:e instanceof u?e.author.id:e instanceof l?e.ownerID:null}resolveGuild(e){return e instanceof l?e:"string"==typeof e?this.client.guilds.get(e)||null:null}resolveGuildMember(e,t){return t instanceof p?t:(e=this.resolveGuild(e),t=this.resolveUser(t),e&&t?e.members.get(t.id)||null:null)}resolveChannel(e){return e instanceof h?e:"string"==typeof e?this.client.channels.get(e)||null:e instanceof u?e.channel:e instanceof l?e.channels.get(e.id)||null:null}resolveChannelID(e){return e instanceof h?e.id:"string"==typeof e?e:e instanceof u?e.channel.id:e instanceof l?e.defaultChannel.id:null}resolveInviteCode(e){const t=/discord(?:app\.com\/invite|\.gg)\/([\w-]{2,255})/i,n=t.exec(e);return n&&n[1]?n[1]:e}resolveString(e){return"string"==typeof e?e:e instanceof Array?e.join("\n"):String(e)}resolveBase64(e){return e instanceof t?`data:image/jpg;base64,${e.toString("base64")}`:e}resolveBuffer(e){return e instanceof t?Promise.resolve(e):this.client.browser&&e instanceof ArrayBuffer?Promise.resolve(a(e)):"string"==typeof e?new Promise((n,o)=>{if(/^https?:\/\//.test(e))r.get(e).end((e,i)=>{if(e)return o(e);if(!(i.body instanceof t))return o(new TypeError("The response body isn't a Buffer."));return n(i.body)});else{const t=i.resolve(e);s.stat(t,(e,i)=>{if(e)return o(e);if(!i||!i.isFile())return o(new Error(`The file could not be found: ${t}`));s.readFile(t,(e,t)=>{e?o(e):n(t)});return null})}}):Promise.reject(new TypeError("The resource must be a string or Buffer."))}resolveEmojiIdentifier(e){return e instanceof d||e instanceof f?e.identifier:"string"==typeof e?this.client.emojis.has(e)?this.client.emojis.get(e).identifier:e.includes("%")?e:encodeURIComponent(e):null}static resolveColor(e){if("string"==typeof e){if("RANDOM"===e)return Math.floor(16777216*Math.random());e=o.Colors[e]||parseInt(e.replace("#",""),16)}else e instanceof Array&&(e=(e[0]<<16)+(e[1]<<8)+e[2]);if(e<0||e>16777215)throw new RangeError("Color must be within the range 0 - 16777215 (0xFFFFFF).");if(e&&isNaN(e))throw new TypeError("Unable to convert color to a number.");return e}resolveColor(e){return this.constructor.resolveColor(e)}}e.exports=m}).call(t,n(5).Buffer)},function(e,t){e.exports={name:"discord.js",version:"11.1.0",description:"A powerful library for interacting with the Discord API",main:"./src/index",types:"./typings/index.d.ts",scripts:{test:"npm run lint && npm run docs:test",docs:"docgen --source src --custom docs/index.yml --output docs/docs.json","docs:test":"docgen --source src --custom docs/index.yml",lint:"eslint src","lint:fix":"eslint --fix src",webpack:"parallel-webpack"},repository:{type:"git",url:"git+https://github.com/hydrabolt/discord.js.git"},keywords:["discord","api","bot","client","node","discordapp"],author:"Amish Shah ",license:"Apache-2.0",bugs:{url:"https://github.com/hydrabolt/discord.js/issues"},homepage:"https://github.com/hydrabolt/discord.js#readme",runkitExampleFilename:"./docs/examples/ping.js",dependencies:{long:"^3.2.0","prism-media":"^0.0.1",snekfetch:"^3.1.0",tweetnacl:"^0.14.0",ws:"^2.0.0"},peerDependencies:{bufferutil:"^2.0.0",erlpack:"hammerandchisel/erlpack","node-opus":"^0.2.5",opusscript:"^0.0.3",sodium:"^2.0.1","libsodium-wrappers":"^0.5.1"},devDependencies:{"@types/node":"^7.0.0","discord.js-docgen":"hydrabolt/discord.js-docgen",eslint:"^3.19.0","parallel-webpack":"^1.6.0","uglify-js":"mishoo/UglifyJS2#harmony",webpack:"^2.2.0"},engines:{node:">=6.0.0"},browser:{ws:!1,uws:!1,erlpack:!1,"prism-media":!1,opusscript:!1,"node-opus":!1,tweetnacl:!1,sodium:!1,"src/sharding/Shard.js":!1,"src/sharding/ShardClientUtil.js":!1,"src/sharding/ShardingManager.js":!1,"src/client/voice/dispatcher/StreamDispatcher.js":!1,"src/client/voice/opus/BaseOpusEngine.js":!1,"src/client/voice/opus/NodeOpusEngine.js":!1,"src/client/voice/opus/OpusEngineList.js":!1,"src/client/voice/opus/OpusScriptEngine.js":!1,"src/client/voice/pcm/ConverterEngine.js":!1,"src/client/voice/pcm/ConverterEngineList.js":!1,"src/client/voice/pcm/FfmpegConverterEngine.js":!1,"src/client/voice/player/AudioPlayer.js":!1,"src/client/voice/receiver/VoiceReadable.js":!1,"src/client/voice/receiver/VoiceReceiver.js":!1,"src/client/voice/util/Secretbox.js":!1,"src/client/voice/util/SecretKey.js":!1,"src/client/voice/util/VolumeInterface.js":!1,"src/client/voice/ClientVoiceManager.js":!1,"src/client/voice/VoiceBroadcast.js":!1,"src/client/voice/VoiceConnection.js":!1,"src/client/voice/VoiceUDPClient.js":!1,"src/client/voice/VoiceWebSocket.js":!1}}},function(e,t,n){const i=n(16),s=n(3),r=n(40);class o extends i{setup(e){super.setup(e),this.verified=e.verified,this.email=e.email,this.localPresence={},this._typing=new Map,this.friends=new s,this.blocked=new s,this.notes=new s,this.premium="boolean"==typeof e.premium?e.premium:null,this.mfaEnabled="boolean"==typeof e.mfa_enabled?e.mfa_enabled:null,this.mobile="boolean"==typeof e.mobile?e.mobile:null,e.user_settings&&(this.settings=new r(this,e.user_settings))}edit(e){return this.client.rest.methods.updateCurrentUser(e)}setUsername(e,t){return this.client.rest.methods.updateCurrentUser({username:e},t)}setEmail(e,t){return this.client.rest.methods.updateCurrentUser({email:e},t)}setPassword(e,t){return this.client.rest.methods.updateCurrentUser({password:e},t)}setAvatar(e){return"string"==typeof e&&e.startsWith("data:")?this.client.rest.methods.updateCurrentUser({avatar:e}):this.client.resolver.resolveBuffer(e).then(e=>this.client.rest.methods.updateCurrentUser({avatar:e}))}setPresence(e){return new Promise(t=>{let n=this.localPresence.status||this.presence.status;let i=this.localPresence.game;let s=this.localPresence.afk||this.presence.afk;!i&&this.presence.game&&(i={name:this.presence.game.name,type:this.presence.game.type,url:this.presence.game.url});if(e.status){if("string"!=typeof e.status)throw new TypeError("Status must be a string");n=e.status}e.game?(i=e.game,i.url&&(i.type=1)):void 0!==e.game&&(i=null);void 0!==e.afk&&(s=e.afk);s=Boolean(s);this.localPresence={status:n,game:i,afk:s};this.localPresence.since=0;this.localPresence.game=this.localPresence.game||null;this.client.ws.send({op:3,d:this.localPresence});this.client._setPresence(this.id,this.localPresence);t(this)})}setStatus(e){return this.setPresence({status:e})}setGame(e,t){return e?this.setPresence({game:{name:e,url:t}}):this.setPresence({game:null})}setAFK(e){return this.setPresence({afk:e})}fetchMentions(e={limit:25,roles:!0,everyone:!0,guild:null}){return this.client.rest.methods.fetchMentions(e)}addFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.addFriend(e)}removeFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.removeFriend(e)}createGuild(e,t,n=null){return n?"string"==typeof n&&n.startsWith("data:")?this.client.rest.methods.createGuild({name:e,icon:n,region:t}):this.client.resolver.resolveBuffer(n).then(n=>this.client.rest.methods.createGuild({name:e,icon:n,region:t})):this.client.rest.methods.createGuild({name:e,icon:n,region:t})}createGroupDM(e){return this.client.rest.methods.createGroupDM({recipients:e.map(e=>this.client.resolver.resolveUserID(e.user)),accessTokens:e.map(e=>e.accessToken),nicks:e.map(e=>e.nick)})}acceptInvite(e){return this.client.rest.methods.acceptInvite(e)}}e.exports=o},function(e,t,n){const i=n(0),s=n(4);class r{constructor(e,t){this.user=e,this.patch(t)}patch(e){for(const t of Object.keys(i.UserSettingsMap)){const n=i.UserSettingsMap[t];e.hasOwnProperty(t)&&("function"==typeof n?this[n.name]=n(e[t]):this[n]=e[t])}}update(e,t){return this.user.client.rest.methods.patchUserSettings({[e]:t})}setGuildPosition(e,t,n){const i=Object.assign([],this.guildPositions);return s.moveElementInArray(i,e.id,t,n),this.update("guild_positions",i).then(()=>e)}addRestrictedGuild(e){const t=Object.assign([],this.restrictedGuilds);return t.includes(e.id)?Promise.reject(new Error("Guild is already restricted")):(t.push(e.id),this.update("restricted_guilds",t).then(()=>e))}removeRestrictedGuild(e){const t=Object.assign([],this.restrictedGuilds),n=t.indexOf(e.id);return n<0?Promise.reject(new Error("Guild is not restricted")):(t.splice(n,1),this.update("restricted_guilds",t).then(()=>e))}}e.exports=r},function(e,t,n){const i=n(14),s=n(22),r=n(3);class o extends i{constructor(e,t){super(e,t),this.type="dm",this.messages=new r,this._typing=new Map}setup(e){super.setup(e),this.recipient=this.client.dataManager.newUser(e.recipients[0]),this.lastMessageID=e.last_message_id}toString(){return this.recipient.toString()}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"]),e.exports=o},function(e,t,n){const i=n(49),s=n(50),r=n(0);class o{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.guild=this.client.guilds.get(e.guild.id)||new i(this.client,e.guild),this.code=e.code,this.temporary=e.temporary,this.maxAge=e.max_age,this.uses=e.uses,this.maxUses=e.max_uses,e.inviter&&(this.inviter=this.client.dataManager.newUser(e.inviter)),this.channel=this.client.channels.get(e.channel.id)||new s(this.client,e.channel),this.createdTimestamp=new Date(e.created_at).getTime()}get createdAt(){return new Date(this.createdTimestamp)}get expiresTimestamp(){return this.createdTimestamp+1e3*this.maxAge}get expiresAt(){return new Date(this.expiresTimestamp)}get url(){return r.Endpoints.inviteLink(this.code)}delete(){return this.client.rest.methods.deleteInvite(this)}toString(){return this.url}}e.exports=o},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"client",{value:e.client}),this.message=e,this.setup(t)}setup(e){this.id=e.id,this.filename=e.filename,this.filesize=e.size,this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}e.exports=n},function(e,t,n){const i=n(66);class s extends i{constructor(e,t,n={}){super(e.client,t,n),this.channel=e,this.received=0,this.client.on("message",this.listener),this.options.max&&(this.options.maxProcessed=this.options.max),this.options.maxMatches&&(this.options.max=this.options.maxMatches),this._reEmitter=(e=>{this.emit("message",e)}),this.on("collect",this._reEmitter)}handle(e){return e.channel.id!==this.channel.id?null:(this.received++,{key:e.id,value:e})}postCheck(){return this.options.maxMatches&&this.collected.size>=this.options.max?"matchesLimit":this.options.max&&this.received>=this.options.maxProcessed?"limit":null}cleanup(){this.removeListener("collect",this._reEmitter),this.client.removeListener("message",this.listener)}}e.exports=s},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"client",{value:e.client}),this.message=e,this.setup(t)}setup(e){if(this.type=e.type,this.title=e.title,this.description=e.description,this.url=e.url,this.color=e.color,this.fields=[],e.fields)for(const t of e.fields)this.fields.push(new c(this,t));this.createdTimestamp=e.timestamp,this.thumbnail=e.thumbnail?new i(this,e.thumbnail):null,this.image=e.image?new s(this,e.image):null,this.video=e.video?new r(this,e.video):null,this.author=e.author?new a(this,e.author):null,this.provider=e.provider?new o(this,e.provider):null,this.footer=e.footer?new u(this,e.footer):null}get createdAt(){return new Date(this.createdTimestamp)}get hexColor(){let e=this.color.toString(16);for(;e.length<6;)e=`0${e}`;return`#${e}`}}class i{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}class s{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}class r{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.height=e.height,this.width=e.width}}class o{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url}}class a{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url,this.iconURL=e.icon_url}}class c{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.value=e.value,this.inline=e.inline}}class u{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.text=e.text,this.iconURL=e.icon_url,this.proxyIconUrl=e.proxy_icon_url}}n.Thumbnail=i,n.Image=s,n.Video=r,n.Provider=o,n.Author=a,n.Field=c,n.Footer=u,e.exports=n},function(e,t,n){const i=n(3);class s{constructor(e,t,n,s){if(this.everyone=Boolean(s),t)if(t instanceof i)this.users=new i(t);else{this.users=new i;for(const n of t){let t=e.client.users.get(n.id);t||(t=e.client.dataManager.newUser(n)),this.users.set(t.id,t)}}else this.users=new i;if(n)if(n instanceof i)this.roles=new i(n);else{this.roles=new i;for(const t of n){const n=e.channel.guild.roles.get(t);n&&this.roles.set(n.id,n)}}else this.roles=new i;this._content=e.content,this._guild=e.channel.guild,this._members=null,this._channels=null}get members(){return this._members?this._members:this._guild?(this._members=new i,this.users.forEach(e=>{const t=this._guild.member(e);t&&this._members.set(t.user.id,t)}),this._members):null}get channels(){if(this._channels)return this._channels;if(!this._guild)return null;this._channels=new i;let e;for(;null!==(e=this.constructor.CHANNELS_PATTERN.exec(this._content));){const t=this._guild.channels.get(e[1]);t&&this._channels.set(t.id,t)}return this._channels}}s.EVERYONE_PATTERN=/@(everyone|here)/g,s.USERS_PATTERN=/<@!?[0-9]+>/g,s.ROLES_PATTERN=/<@&[0-9]+>/g,s.CHANNELS_PATTERN=/<#([0-9]+)>/g,e.exports=s},function(e,t,n){const i=n(3),s=n(17),r=n(29);class o{constructor(e,t,n,s){this.message=e,this.me=s,this.count=n||0,this.users=new i,this._emoji=new r(this,t.name,t.id)}get emoji(){if(this._emoji instanceof s)return this._emoji;if(this._emoji.id){const e=this.message.client.emojis;if(e.has(this._emoji.id)){const t=e.get(this._emoji.id);return this._emoji=t,t}}return this._emoji}remove(e=this.message.client.user){const t=this.message,n=this.message.client.resolver.resolveUserID(e);return n?t.client.rest.methods.removeMessageReaction(t,this.emoji.identifier,n):Promise.reject(new Error("Couldn't resolve the user ID to remove from the reaction."))}fetchUsers(e=100){const t=this.message;return t.client.rest.methods.getMessageReactionUsers(t,this.emoji.identifier,e).then(e=>{this.users=new i;for(const t of e){const e=this.message.client.dataManager.newUser(t);this.users.set(e.id,e)}this.count=this.users.size;return this.users})}}e.exports=o},function(e,t,n){const i=n(7);class s{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.description=e.description,this.icon=e.icon,this.iconURL=`https://cdn.discordapp.com/app-icons/${this.id}/${this.icon}.jpg`,this.rpcOrigins=e.rpc_origins,this.redirectURIs=e.redirect_uris,this.botRequireCodeGrant=e.bot_require_code_grant,this.botPublic=e.bot_public,this.rpcApplicationState=e.rpc_application_state,this.bot=e.bot,this.flags=e.flags,this.secret=e.secret}get createdTimestamp(){return i.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}reset(){return this.client.rest.methods.resetApplication(this.id)}toString(){return this.name}}e.exports=s},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.icon=e.icon,this.splash=e.splash}}e.exports=n},function(e,t,n){const i=n(0);class s{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.type=i.ChannelTypes.TEXT===e.type?"text":"voice"}}e.exports=s},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"channel",{value:e}),t&&this.setup(t)}setup(e){this.id=e.id,this.type=e.type,this.deny=e.deny,this.allow=e.allow}delete(){return this.channel.client.rest.methods.deletePermissionOverwrites(this)}}e.exports=n},function(e,t,n){const i=n(25),s=n(22),r=n(3);class o extends i{constructor(e,t){super(e,t),this.type="text",this.messages=new r,this._typing=new Map}setup(e){super.setup(e),this.topic=e.topic,this.lastMessageID=e.last_message_id}get members(){const e=new r;for(const t of this.guild.members.values())this.permissionsFor(t).hasPermission("READ_MESSAGES")&&e.set(t.id,t);return e}fetchWebhooks(){return this.client.rest.methods.getChannelWebhooks(this)}createWebhook(e,t){return new Promise(n=>{"string"==typeof t&&t.startsWith("data:")?n(this.client.rest.methods.createWebhook(this,e,t)):this.client.resolver.resolveBuffer(t).then(t=>n(this.client.rest.methods.createWebhook(this,e,t)))})}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendFiles(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}createMessageCollector(){}awaitMessages(){}bulkDelete(){}acknowledge(){}_cacheMessage(){}}s.applyToClass(o,!0),e.exports=o},function(e,t,n){const i=n(25),s=n(3);class r extends i{constructor(e,t){super(e,t),this.members=new s,this.type="voice"}setup(e){super.setup(e),this.bitrate=e.bitrate,this.userLimit=e.user_limit}get connection(){const e=this.guild.voiceConnection;return e&&e.channel.id===this.id?e:null}get full(){return this.userLimit>0&&this.members.size>=this.userLimit}get joinable(){return!this.client.browser&&(!!this.permissionsFor(this.client.user).hasPermission("CONNECT")&&!(this.full&&!this.permissionsFor(this.client.user).hasPermission("MOVE_MEMBERS")))}get speakable(){return this.permissionsFor(this.client.user).hasPermission("SPEAK")}setBitrate(e){return this.edit({bitrate:e})}setUserLimit(e){return this.edit({userLimit:e})}join(){return this.client.browser?Promise.reject(new Error("Voice connections are not available in browsers.")):this.client.voice.joinChannel(this)}leave(){if(!this.client.browser){const e=this.client.voice.connections.get(this.guild.id);e&&e.channel.id===this.id&&e.disconnect()}}}e.exports=r},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(t){function i(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?M(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function s(e,t){S=S||n(13),e=e||{},this.objectMode=!!e.objectMode,t instanceof S&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:s,this.highWaterMark=~~this.highWaterMark,this.buffer=new G,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(P||(P=n(62).StringDecoder),this.decoder=new P(e.encoding),this.encoding=e.encoding)}function r(e){if(S=S||n(13),!(this instanceof r))return new r(e);this._readableState=new s(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),I.call(this)}function o(e,t,n,i,s){var r=l(t,n);if(r)e.emit("error",r);else if(null===n)t.reading=!1,h(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!s){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&s){var c=new Error("stream.unshift() after end event");e.emit("error",c)}else{var u;!t.decoder||s||i||(n=t.decoder.write(n),u=!t.objectMode&&0===n.length),s||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,s?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&p(e))),f(e,t)}else s||(t.reading=!1);return a(t)}function a(e){return!e.ended&&(e.needReadable||e.length=B?e=B:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function u(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=c(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function l(e,t){var n=null;return U.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function h(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,p(e)}}function p(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(j("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?D(d,e):d(e))}function d(e){j("emit readable"),e.emit("readable"),w(e)}function f(e,t){t.readingMore||(t.readingMore=!0,D(m,e,t))}function m(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=_(e,t.buffer,t.decoder),n}function _(e,t,n){var i;return er.length?r.length:e;if(o===r.length?s+=r:s+=r.slice(0,e),0===(e-=o)){o===r.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=r.slice(o));break}++i}return t.length-=i,s}function R(e,t){var n=L.allocUnsafe(e),i=t.head,s=1;for(i.data.copy(n),e-=i.data.length;i=i.next;){var r=i.data,o=e>r.length?r.length:e;if(r.copy(n,n.length-e,0,o),0===(e-=o)){o===r.length?(++s,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=r.slice(o));break}++s}return t.length-=s,n}function A(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,D(k,t,e))}function k(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function T(e,t){for(var n=0,i=e.length;n=t.highWaterMark||t.ended))return j("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?A(this):p(this),null;if(0===(e=u(e,t))&&t.ended)return 0===t.length&&A(this),null;var i=t.needReadable;j("need readable",i),(0===t.length||t.length-e0?y(e,t):null,null===s?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&A(this)),null!==s&&this.emit("data",s),s},r.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},r.prototype.pipe=function(e,n){function s(e){j("onunpipe"),e===p&&o()}function r(){j("onend"),e.end()}function o(){j("cleanup"),e.removeListener("close",u),e.removeListener("finish",l),e.removeListener("drain",v),e.removeListener("error",c),e.removeListener("unpipe",s),p.removeListener("end",r),p.removeListener("end",o),p.removeListener("data",a),b=!0,!d.awaitDrain||e._writableState&&!e._writableState.needDrain||v()}function a(t){j("ondata"),E=!1,!1!==e.write(t)||E||((1===d.pipesCount&&d.pipes===e||d.pipesCount>1&&-1!==T(d.pipes,e))&&!b&&(j("false write response, pause",p._readableState.awaitDrain),p._readableState.awaitDrain++,E=!0),p.pause())}function c(t){j("onerror",t),h(),e.removeListener("error",c),0===C(e,"error")&&e.emit("error",t)}function u(){e.removeListener("finish",l),h()}function l(){j("onfinish"),e.removeListener("close",u),h()}function h(){j("unpipe"),p.unpipe(e)}var p=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,j("pipe count=%d opts=%j",d.pipesCount,n);var f=(!n||!1!==n.end)&&e!==t.stdout&&e!==t.stderr,m=f?r:o;d.endEmitted?D(m):p.once("end",m),e.on("unpipe",s);var v=g(p);e.on("drain",v);var b=!1,E=!1;return p.on("data",a),i(e,"error",c),e.once("close",u),e.once("finish",l),e.emit("pipe",p),d.flowing||(j("pipe resume"),p.resume()),e},r.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s",'"',"`"," ","\r","\n","\t"],f=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(f),g=["%","/","?",";","#"].concat(m),v=["/","?","#"],b={javascript:!0,"javascript:":!0},E={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(34);i.prototype.parse=function(e,t,n){if(!u.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i127?C+="x":C+=M[I];if(!C.match(/^[+a-z0-9A-Z_-]{0,63}$/)){var L=S.slice(0,x),O=S.slice(x+1),N=M.match(/^([+a-z0-9A-Z_-]{0,63})(.*)$/);N&&(L.push(N[1]),O.unshift(N[2])),O.length&&(o="/"+O.join(".")+o),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=c.toASCII(this.hostname));var j=this.port?":"+this.port:"",P=this.hostname||"";this.host=P+j,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!b[d])for(var x=0,D=m.length;x0)&&n.host.split("@");A&&(n.auth=A.shift(),n.host=n.hostname=A.shift())}return n.search=e.search,n.query=e.query,u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var k=x.slice(-1)[0],T=(n.host||e.host||x.length>1)&&("."===k||".."===k)||""===k,S=0,D=x.length;D>=0;D--)k=x[D],"."===k?x.splice(D,1):".."===k?(x.splice(D,1),S++):S&&(x.splice(D,1),S--);if(!y&&!_)for(;S--;S)x.unshift("..");!y||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),T&&"/"!==x.join("/").substr(-1)&&x.push("");var M=""===x[0]||x[0]&&"/"===x[0].charAt(0);if(R){n.hostname=n.host=M?"":x.length?x.shift():"";var A=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");A&&(n.auth=A.shift(),n.host=n.hostname=A.shift())}return y=y||n.host&&x.length,y&&!M&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=h.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){function i(e){if(e&&!c(e))throw new Error("Unknown encoding: "+e)}function s(e){return e.toString(this.encoding)}function r(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function o(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var a=n(5).Buffer,c=a.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},u=t.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),i(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=r;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=o;break;default:return void(this.write=s)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};u.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var s=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,s),s-=this.charReceived),t+=e.toString(this.encoding,0,s);var s=t.length-1,i=t.charCodeAt(s);if(i>=55296&&i<=56319){var r=this.surrogateSize;return this.charLength+=r,this.charReceived+=r,this.charBuffer.copy(this.charBuffer,r,0,r),e.copy(this.charBuffer,0,0,r),t.substring(0,s)}return t},u.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},u.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,i=this.charBuffer,s=this.encoding;t+=i.slice(0,n).toString(s)}return t}},function(e,t,n){const i=n(139),s=n(136),r=n(138),o=n(137),a=n(135),c=n(0);class u{constructor(e){this.client=e,this.handlers={},this.userAgentManager=new i(this),this.methods=new s(this),this.rateLimitedEndpoints={},this.globallyRateLimited=!1}push(e,t){return new Promise((n,i)=>{e.push({request:t,resolve:n,reject:i})})}getRequestHandler(){switch(this.client.options.apiRequestMethod){case"sequential":return r;case"burst":return o;default:throw new Error(c.Errors.INVALID_RATE_LIMIT_METHOD)}}makeRequest(e,t,n,i,s){const r=new a(this,e,t,n,i,s);if(!this.handlers[r.route]){const e=this.getRequestHandler();this.handlers[r.route]=new e(this,r.route)}return this.push(this.handlers[r.route],r)}}e.exports=u},function(e,t){class n{constructor(e){this.restManager=e,this.queue=[]}get globalLimit(){return this.restManager.globallyRateLimited}set globalLimit(e){this.restManager.globallyRateLimited=e}push(e){this.queue.push(e)}handle(){}}e.exports=n},function(e,t,n){(function(t){const i="browser"===n(23).platform(),s=n(12),r=n(27),o=function(){try{const e=n(187);return e.pack?e:null}catch(e){return null}}(),a=function(){if(i)return window.WebSocket;try{return n(188)}catch(e){return n(189)}}();class c extends s{constructor(e){super(e),this.ws=new a(e),i&&(this.ws.binaryType="arraybuffer"),this.ws.onmessage=this.eventMessage.bind(this),this.ws.onopen=this.emit.bind(this,"open"),this.ws.onclose=this.emit.bind(this,"close"),this.ws.onerror=this.emit.bind(this,"error")}eventMessage(e){try{const t=this.unpack(e.data);return this.emit("packet",t),!0}catch(e){return this.listenerCount("decodeError")&&this.emit("decodeError",e),!1}}send(e){this.ws.send(this.pack(e))}pack(e){return o?o.pack(e):JSON.stringify(e)}unpack(e){return o&&"string"!=typeof e?(e instanceof ArrayBuffer&&(e=t.from(new Uint8Array(e))),o.unpack(e)):((e instanceof ArrayBuffer||e instanceof t)&&(e=this.inflate(e)),JSON.parse(e))}inflate(e){return o?e:r.inflateSync(e).toString()}get readyState(){return this.ws.readyState}close(e,t){this.ws.close(e,t)}}c.ENCODING=o?"etf":"json",c.WebSocket=a,e.exports=c}).call(t,n(5).Buffer)},function(e,t,n){const i=n(3),s=n(12).EventEmitter;class r extends s{constructor(e,t,n={}){super(),this.client=e,this.filter=t,this.options=n,this.collected=new i,this.ended=!1,this._timeout=null,this.listener=this._handle.bind(this),n.time&&(this._timeout=this.client.setTimeout(()=>this.stop("time"),n.time))}_handle(...e){const t=this.handle(...e);if(t&&this.filter(...e)){this.collected.set(t.key,t.value),this.emit("collect",t.value,this);const n=this.postCheck(...e);n&&this.stop(n)}}get next(){return new Promise((e,t)=>{if(this.ended)return void t(this.collected);const n=()=>{this.removeListener("collect",i);this.removeListener("end",s)};const i=t=>{n();e(t)};const s=()=>{n();t(this.collected)};this.on("collect",i);this.on("end",s)})}stop(e="user"){this.ended||(this._timeout&&this.client.clearTimeout(this._timeout),this.ended=!0,this.cleanup(),this.emit("end",this.collected,e))}handle(){}postCheck(){}cleanup(){}}e.exports=r},function(module,exports,__webpack_require__){(function(process){const os=__webpack_require__(23),EventEmitter=__webpack_require__(12).EventEmitter,Constants=__webpack_require__(0),Permissions=__webpack_require__(9),Util=__webpack_require__(4),RESTManager=__webpack_require__(63),ClientDataManager=__webpack_require__(104),ClientManager=__webpack_require__(105),ClientDataResolver=__webpack_require__(37),ClientVoiceManager=__webpack_require__(185),WebSocketManager=__webpack_require__(140),ActionsManager=__webpack_require__(106),Collection=__webpack_require__(3),Presence=__webpack_require__(11).Presence,ShardClientUtil=__webpack_require__(184),VoiceBroadcast=__webpack_require__(186);class Client extends EventEmitter{constructor(e={}){super(),!e.shardId&&"SHARD_ID"in process.env&&(e.shardId=Number(process.env.SHARD_ID)),!e.shardCount&&"SHARD_COUNT"in process.env&&(e.shardCount=Number(process.env.SHARD_COUNT)),this.options=Util.mergeDefault(Constants.DefaultOptions,e),this._validateOptions(),this.rest=new RESTManager(this),this.dataManager=new ClientDataManager(this),this.manager=new ClientManager(this),this.ws=new WebSocketManager(this),this.resolver=new ClientDataResolver(this),this.actions=new ActionsManager(this),this.voice=this.browser?null:new ClientVoiceManager(this),this.shard=process.send?ShardClientUtil.singleton(this):null,this.users=new Collection,this.guilds=new Collection,this.channels=new Collection,this.presences=new Collection,!this.token&&"CLIENT_TOKEN"in process.env?this.token=process.env.CLIENT_TOKEN:this.token=null,this.user=null,this.readyAt=null,this.broadcasts=[],this.pings=[],this._pingTimestamp=0,this._timeouts=new Set,this._intervals=new Set,this.options.messageSweepInterval>0&&this.setInterval(this.sweepMessages.bind(this),1e3*this.options.messageSweepInterval)}get status(){return this.ws.status}get uptime(){return this.readyAt?Date.now()-this.readyAt:null}get ping(){return this.pings.reduce((e,t)=>e+t,0)/this.pings.length}get voiceConnections(){return this.browser?new Collection:this.voice.connections}get emojis(){const e=new Collection;for(const t of this.guilds.values())for(const n of t.emojis.values())e.set(n.id,n);return e}get readyTimestamp(){return this.readyAt?this.readyAt.getTime():null}get browser(){return"browser"===os.platform()}createVoiceBroadcast(){const e=new VoiceBroadcast(this);return this.broadcasts.push(e),e}login(e){return this.rest.methods.login(e)}destroy(){for(const e of this._timeouts)clearTimeout(e);for(const e of this._intervals)clearInterval(e);return this._timeouts.clear(),this._intervals.clear(),this.manager.destroy()}syncGuilds(e=this.guilds){this.user.bot||this.ws.send({op:12,d:e instanceof Collection?e.keyArray():e.map(e=>e.id)})}fetchUser(e,t=!0){return this.users.has(e)?Promise.resolve(this.users.get(e)):this.rest.methods.getUser(e,t)}fetchInvite(e){const t=this.resolver.resolveInviteCode(e);return this.rest.methods.getInvite(t)}fetchWebhook(e,t){return this.rest.methods.getWebhook(e,t)}fetchVoiceRegions(){return this.rest.methods.fetchVoiceRegions()}sweepMessages(e=this.options.messageCacheLifetime){if("number"!=typeof e||isNaN(e))throw new TypeError("The lifetime must be a number.");if(e<=0)return this.emit("debug","Didn't sweep messages - lifetime is unlimited"),-1;const t=1e3*e,n=Date.now();let i=0,s=0;for(const e of this.channels.values())if(e.messages){i++;for(const i of e.messages.values())n-(i.editedTimestamp||i.createdTimestamp)>t&&(e.messages.delete(i.id),s++)}return this.emit("debug",`Swept ${s} messages older than ${e} seconds in ${i} text-based channels`),s}fetchApplication(e="@me"){return this.rest.methods.getApplication(e)}generateInvite(e){return e?e instanceof Array&&(e=Permissions.resolve(e)):e=0,this.fetchApplication().then(t=>`https://discordapp.com/oauth2/authorize?client_id=${t.id}&permissions=${e}&scope=bot`)}setTimeout(e,t,...n){const i=setTimeout(()=>{e();this._timeouts.delete(i)},t,...n);return this._timeouts.add(i),i}clearTimeout(e){clearTimeout(e),this._timeouts.delete(e)}setInterval(e,t,...n){const i=setInterval(e,t,...n);return this._intervals.add(i),i}clearInterval(e){clearInterval(e),this._intervals.delete(e)}_pong(e){this.pings.unshift(Date.now()-e),this.pings.length>3&&(this.pings.length=3),this.ws.lastHeartbeatAck=!0}_setPresence(e,t){if(this.presences.has(e))return void this.presences.get(e).update(t);this.presences.set(e,new Presence(t))}_eval(script){return eval(script)}_validateOptions(e=this.options){if("number"!=typeof e.shardCount||isNaN(e.shardCount))throw new TypeError("The shardCount option must be a number.");if("number"!=typeof e.shardId||isNaN(e.shardId))throw new TypeError("The shardId option must be a number.");if(e.shardCount<0)throw new RangeError("The shardCount option must be at least 0.");if(e.shardId<0)throw new RangeError("The shardId option must be at least 0.");if(0!==e.shardId&&e.shardId>=e.shardCount)throw new RangeError("The shardId option must be less than shardCount.");if("number"!=typeof e.messageCacheMaxSize||isNaN(e.messageCacheMaxSize))throw new TypeError("The messageCacheMaxSize option must be a number.");if("number"!=typeof e.messageCacheLifetime||isNaN(e.messageCacheLifetime))throw new TypeError("The messageCacheLifetime option must be a number.");if("number"!=typeof e.messageSweepInterval||isNaN(e.messageSweepInterval))throw new TypeError("The messageSweepInterval option must be a number.");if("boolean"!=typeof e.fetchAllMembers)throw new TypeError("The fetchAllMembers option must be a boolean.");if("boolean"!=typeof e.disableEveryone)throw new TypeError("The disableEveryone option must be a boolean.");if("number"!=typeof e.restWsBridgeTimeout||isNaN(e.restWsBridgeTimeout))throw new TypeError("The restWsBridgeTimeout option must be a number.");if(!(e.disabledEvents instanceof Array))throw new TypeError("The disabledEvents option must be an Array.")}}module.exports=Client}).call(exports,__webpack_require__(6))},function(e,t,n){const i=n(30),s=n(63),r=n(37),o=n(0),a=n(4);class c extends i{constructor(e,t,n){super(null,e,t),this.options=a.mergeDefault(o.DefaultOptions,n),this.rest=new s(this),this.resolver=new r(this),this._timeouts=new Set,this._intervals=new Set}setTimeout(e,t,...n){const i=setTimeout(()=>{e();this._timeouts.delete(i)},t,...n);return this._timeouts.add(i),i}clearTimeout(e){clearTimeout(e),this._timeouts.delete(e)}setInterval(e,t,...n){const i=setInterval(e,t,...n);return this._intervals.add(i),i}clearInterval(e){clearInterval(e),this._intervals.delete(e)}destroy(){for(const e of this._timeouts)clearTimeout(e);for(const e of this._intervals)clearInterval(e);this._timeouts.clear(),this._intervals.clear()}}e.exports=c},function(e,t,n){function i(e){return"string"==typeof e?e:e instanceof Array?e.join("\n"):String(e)}const s=n(37);class r{constructor(e={}){this.title=e.title,this.description=e.description,this.url=e.url,this.color=e.color,this.author=e.author,this.timestamp=e.timestamp,this.fields=e.fields||[],this.thumbnail=e.thumbnail,this.image=e.image,this.footer=e.footer,this.file=e.file}setTitle(e){if(e=i(e),e.length>256)throw new RangeError("RichEmbed titles may not exceed 256 characters.");return this.title=e,this}setDescription(e){if(e=i(e),e.length>2048)throw new RangeError("RichEmbed descriptions may not exceed 2048 characters.");return this.description=e,this}setURL(e){return this.url=e,this}setColor(e){return this.color=s.resolveColor(e),this}setAuthor(e,t,n){return this.author={name:i(e),icon_url:t,url:n},this}setTimestamp(e=new Date){return this.timestamp=e,this}addField(e,t,n=!1){if(this.fields.length>=25)throw new RangeError("RichEmbeds may not exceed 25 fields.");if(e=i(e),e.length>256)throw new RangeError("RichEmbed field names may not exceed 256 characters.");if(!/\S/.test(e))throw new RangeError("RichEmbed field names may not be empty.");if(t=i(t),t.length>1024)throw new RangeError("RichEmbed field values may not exceed 1024 characters.");if(!/\S/.test(t))throw new RangeError("RichEmbed field values may not be empty.");return this.fields.push({name:e,value:t,inline:n}),this}addBlankField(e=!1){return this.addField("​","​",e)}setThumbnail(e){return this.thumbnail={url:e},this}setImage(e){return this.image={url:e},this}setFooter(e,t){if(e=i(e),e.length>2048)throw new RangeError("RichEmbed footer text may not exceed 2048 characters.");return this.footer={text:e,icon_url:t},this}attachFile(e){if(this.file)throw new RangeError("You may not upload more than one file at once.");return this.file=e,this}}e.exports=r},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";function i(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function s(e){return 3*e.length/4-i(e)}function r(e){var t,n,s,r,o,a,c=e.length;o=i(e),a=new h(3*c/4-o),s=o>0?c-4:c;var u=0;for(t=0,n=0;t>16&255,a[u++]=r>>8&255,a[u++]=255&r;return 2===o?(r=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,a[u++]=255&r):1===o&&(r=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,a[u++]=r>>8&255,a[u++]=255&r),a}function o(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function a(e,t,n){for(var i,s=[],r=t;rc?c:o+16383));return 1===i?(t=e[n-1],s+=u[t>>2],s+=u[t<<4&63],s+="=="):2===i&&(t=(e[n-2]<<8)+e[n-1],s+=u[t>>10],s+=u[t>>4&63],s+=u[t<<2&63],s+="="),r.push(s),r.join("")}t.byteLength=s,t.toByteArray=r,t.fromByteArray=c;for(var u=[],l=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,f=p.length;d>1,l=-7,h=n?s-1:0,p=n?-1:1,d=e[t+h];for(h+=p,r=d&(1<<-l)-1,d>>=-l,l+=a;l>0;r=256*r+e[t+h],h+=p,l-=8);for(o=r&(1<<-l)-1,r>>=-l,l+=i;l>0;o=256*o+e[t+h],h+=p,l-=8);if(0===r)r=1-u;else{if(r===c)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,i),r-=u}return(d?-1:1)*o*Math.pow(2,r-i)},t.write=function(e,t,n,i,s,r){var o,a,c,u=8*r-s-1,l=(1<>1,p=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:r-1,f=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),t+=o+h>=1?p/c:p*Math.pow(2,1-h),t*c>=2&&(o++,c/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(t*c-1)*Math.pow(2,s),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,s),o=0));s>=8;e[n+d]=255&a,d+=f,a/=256,s-=8);for(o=o<0;e[n+d]=255&o,d+=f,o/=256,u-=8);e[n+d-f]|=128*m}},function(e,t,n){(function(e,i){var s;!function(r){function o(e){throw new RangeError(I[e])}function a(e,t){for(var n=e.length,i=[];n--;)i[n]=t(e[n]);return i}function c(e,t){var n=e.split("@"),i="";return n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(C,"."),i+a(e.split("."),t).join(".")}function u(e){for(var t,n,i=[],s=0,r=e.length;s=55296&&t<=56319&&s65535&&(e-=65536,t+=O(e>>>10&1023|55296),e=56320|1023&e),t+=O(e)}).join("")}function h(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:y}function p(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function d(e,t,n){var i=0;for(e=n?L(e/A):e>>1,e+=L(e/t);e>U*x>>1;i+=y)e=L(e/U);return L(i+(U+1)*e/(e+R))}function f(e){var t,n,i,s,r,a,c,u,p,f,m=[],g=e.length,v=0,b=T,E=k;for(n=e.lastIndexOf(S),n<0&&(n=0),i=0;i=128&&o("not-basic"),m.push(e.charCodeAt(i));for(s=n>0?n+1:0;s=g&&o("invalid-input"),u=h(e.charCodeAt(s++)),(u>=y||u>L((w-v)/a))&&o("overflow"),v+=u*a,p=c<=E?_:c>=E+x?x:c-E,!(uL(w/f)&&o("overflow"),a*=f;t=m.length+1,E=d(v-r,t,0==r),L(v/t)>w-b&&o("overflow"),b+=L(v/t),v%=t,m.splice(v++,0,b)}return l(m)}function m(e){var t,n,i,s,r,a,c,l,h,f,m,g,v,b,E,R=[];for(e=u(e),g=e.length,t=T,n=0,r=k,a=0;a=t&&mL((w-n)/v)&&o("overflow"),n+=(c-t)*v,t=c,a=0;aw&&o("overflow"),m==t){for(l=n,h=y;f=h<=r?_:h>=r+x?x:h-r,!(l= 0x80 (not a basic code point)","invalid-input":"Invalid input"},U=y-_,L=Math.floor,O=String.fromCharCode;E={version:"1.4.1",ucs2:{decode:u,encode:l},decode:f,encode:m,toASCII:v,toUnicode:g},void 0!==(s=function(){return E}.call(t,n,t,e))&&(e.exports=s)}()}).call(t,n(102)(e),n(8))},function(e,t,n){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,r){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;e=e.split(t);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var u=0;u=0?(l=f.substr(0,m),h=f.substr(m+1)):(l=f,h=""),p=decodeURIComponent(l),d=decodeURIComponent(h),i(o,p)?s(o[p])?o[p].push(d):o[p]=[o[p],d]:o[p]=d}return o};var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";function i(e,t){if(e.map)return e.map(t);for(var n=[],i=0;i0?this.tail.next=t:this.head=t,this.tail=t,++this.length},i.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},i.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},i.prototype.clear=function(){this.head=this.tail=null,this.length=0},i.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},i.prototype.concat=function(e){if(0===this.length)return s.alloc(0);if(1===this.length)return this.head.data;for(var t=s.allocUnsafe(e>>>0),n=this.head,i=0;n;)n.data.copy(t,i),i+=n.data.length,n=n.next;return t}},function(e,t,n){e.exports=n(21).PassThrough},function(e,t,n){e.exports=n(21).Transform},function(e,t,n){e.exports=n(35)},function(e,t,n){(function(e,t){!function(e,n){"use strict";function i(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n=3.1.0 <4.0.0",type:"range"},"/home/travis/build/hydrabolt/discord.js"]],_from:"snekfetch@>=3.1.0 <4.0.0",_id:"snekfetch@3.1.2",_inCache:!0,_location:"/snekfetch",_nodeVersion:"7.9.0",_npmOperationalInternal:{host:"packages-18-east.internal.npmjs.com",tmp:"tmp/snekfetch-3.1.2.tgz_1492882967312_0.8088863184675574"},_npmUser:{name:"crawl",email:"icrawltogo@gmail.com"},_npmVersion:"4.2.0",_phantomChildren:{},_requested:{raw:"snekfetch@^3.1.0",scope:null,escapedName:"snekfetch",name:"snekfetch",rawSpec:"^3.1.0",spec:">=3.1.0 <4.0.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.2.tgz",_shasum:"3422a9191c1bb6610867db88e669db0b5adb7f42",_shrinkwrap:null,_spec:"snekfetch@^3.1.0",_where:"/home/travis/build/hydrabolt/discord.js",author:{name:"Gus Caplan",email:"me@gus.host"},bugs:{url:"https://github.com/GusCaplan/snekfetch/issues"},dependencies:{},description:"Just do http requests without all that weird nastiness from other libs",devDependencies:{},directories:{},dist:{shasum:"3422a9191c1bb6610867db88e669db0b5adb7f42",tarball:"https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.2.tgz"},gitHead:"a79f6867d21ca58ffe6fc59eb77b06f257f8ad29",homepage:"https://github.com/GusCaplan/snekfetch#readme",license:"MIT",main:"index.js",maintainers:[{name:"crawl",email:"icrawltogo@gmail.com"},{name:"snek",email:"me@gus.host"}],name:"snekfetch",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/GusCaplan/snekfetch.git"},scripts:{},version:"3.1.2"}},function(e,t,n){(function(t){const i=n(26),s=n(90);class r{constructor(){this.boundary=`--snekfetch--${Math.random().toString().slice(2,7)}`,this.buffer=new t(0)}append(e,n,r){if(void 0!==n){let o=` --${this.boundary} Content-Disposition: form-data; name="${e}"`,a=null;if(r){o+=`; filename="${r}"`,a="application/octet-stream";const e=i.extname(r);e&&(a=s.lookup(e))}n instanceof t?a=s.buffer(n):"object"==typeof n?(a="application/json",n=t.from(JSON.stringify(n))):n=t.from(String(n)),a&&(o+=` Content-Type: ${a}`),this.buffer=t.concat([this.buffer,t.from(`${o}