diff --git a/discord.master.js b/discord.master.js index 8aaf5096..0b9ca546 100644 --- a/discord.master.js +++ b/discord.master.js @@ -8253,9 +8253,9 @@ class Guild { */ ban(user, options = {}) { if (typeof options === 'number') { - options = { reason: null, days: options }; + options = { reason: null, 'delete-message-days': options }; } else if (typeof options === 'string') { - options = { reason: options, days: 0 }; + options = { reason: options, 'delete-message-days': 0 }; } return this.client.rest.methods.banGuildMember(this, user, options); } diff --git a/discord.master.min.js b/discord.master.min.js index 371695ab..95eac6c5 100644 --- a/discord.master.min.js +++ b/discord.master.min.js @@ -6,7 +6,7 @@ */ var $=n(76),X=n(79),Z=n(57);t.Buffer=r,t.SlowBuffer=m,t.INSPECT_MAX_BYTES=50,r.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=i(),r.poolSize=8192,r._augment=function(e){return e.__proto__=r.prototype,e},r.from=function(e,t,n){return o(null,e,t,n)},r.TYPED_ARRAY_SUPPORT&&(r.prototype.__proto__=Uint8Array.prototype,r.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&r[Symbol.species]===r&&Object.defineProperty(r,Symbol.species,{value:null,configurable:!0})),r.alloc=function(e,t,n){return c(null,e,t,n)},r.allocUnsafe=function(e){return u(null,e)},r.allocUnsafeSlow=function(e){return u(null,e)},r.isBuffer=function(e){return!(null==e||!e._isBuffer)},r.compare=function(e,t){if(!r.isBuffer(e)||!r.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,s=0,o=Math.min(n,i);s0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},r.prototype.compare=function(e,t,n,i,s){if(!r.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===s&&(s=this.length),t<0||n>e.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&t>=n)return 0;if(i>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,s>>>=0,this===e)return 0;for(var o=s-i,a=n-t,c=Math.min(o,a),u=this.slice(i,s),l=e.slice(t,n),h=0;hs)&&(n=s),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var r=!1;;)switch(i){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return x(this,e,t,n);case"latin1":case"binary":return R(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),r=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;r.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(s*=256);)i+=this[e+--t]*s;return i},r.prototype.readUInt8=function(e,t){return t||U(e,1,this.length),this[e]},r.prototype.readUInt16LE=function(e,t){return t||U(e,2,this.length),this[e]|this[e+1]<<8},r.prototype.readUInt16BE=function(e,t){return t||U(e,2,this.length),this[e]<<8|this[e+1]},r.prototype.readUInt32LE=function(e,t){return t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},r.prototype.readUInt32BE=function(e,t){return t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},r.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||U(e,t,this.length);for(var i=this[e],s=1,r=0;++r=s&&(i-=Math.pow(2,8*t)),i},r.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||U(e,t,this.length);for(var i=t,s=1,r=this[e+--i];i>0&&(s*=256);)r+=this[e+--i]*s;return s*=128,r>=s&&(r-=Math.pow(2,8*t)),r},r.prototype.readInt8=function(e,t){return t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},r.prototype.readInt16LE=function(e,t){t||U(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt16BE=function(e,t){t||U(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt32LE=function(e,t){return t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},r.prototype.readInt32BE=function(e,t){return t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},r.prototype.readFloatLE=function(e,t){return t||U(e,4,this.length),X.read(this,e,!0,23,4)},r.prototype.readFloatBE=function(e,t){return t||U(e,4,this.length),X.read(this,e,!1,23,4)},r.prototype.readDoubleLE=function(e,t){return t||U(e,8,this.length),X.read(this,e,!0,52,8)},r.prototype.readDoubleBE=function(e,t){return t||U(e,8,this.length),X.read(this,e,!1,52,8)},r.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t|=0,n|=0,!i){O(this,e,t,n,Math.pow(2,8*n)-1,0)}var s=1,r=0;for(this[t]=255&e;++r=0&&(r*=256);)this[t+s]=e/r&255;return t+n},r.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,255,0),r.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},r.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},r.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},r.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},r.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},r.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t|=0,!i){var s=Math.pow(2,8*n-1);O(this,e,t,n,s-1,-s)}var r=0,o=1,a=0;for(this[t]=255&e;++r>0)-a&255;return t+n},r.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t|=0,!i){var s=Math.pow(2,8*n-1);O(this,e,t,n,s-1,-s)}var r=n-1,o=1,a=0;for(this[t+r]=255&e;--r>=0&&(o*=256);)e<0&&0===a&&0!==this[t+r+1]&&(a=1),this[t+r]=(e/o>>0)-a&255;return t+n},r.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,127,-128),r.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},r.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},r.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},r.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),r.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},r.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},r.prototype.writeFloatLE=function(e,t,n){return G(this,e,t,!0,n)},r.prototype.writeFloatBE=function(e,t,n){return G(this,e,t,!1,n)},r.prototype.writeDoubleLE=function(e,t,n){return q(this,e,t,!0,n)},r.prototype.writeDoubleBE=function(e,t,n){return q(this,e,t,!1,n)},r.prototype.copy=function(e,t,n,i){if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t=0;--s)e[s+t]=this[s+n];else if(o<1e3||!r.TYPED_ARRAY_SUPPORT)for(s=0;s>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;o1)for(var n=1;n=t?String(e):(String(n).repeat(t)+e).slice(-t)}const s=n(34);let r=0;class o{constructor(){throw new Error(`The ${this.constructor.name} class may not be instantiated.`)}static generate(){r>=4095&&(r=0);const e=`${i((Date.now()-14200704e5).toString(2),42)}0000100000${i((r++).toString(2),12)}`;return s.fromString(e,2).toString()}static deconstruct(e){const t=i(s.fromString(e).toString(2),64),n={timestamp:parseInt(t.substring(0,42),2)+14200704e5,workerID:parseInt(t.substring(42,47),2),processID:parseInt(t.substring(47,52),2),increment:parseInt(t.substring(52,64),2),binary:t};return Object.defineProperty(n,"date",{get:function(){return new Date(this.timestamp)},enumerable:!0}),n}}e.exports=o},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){const i=n(0),s=n(22);class r{constructor(e,t){t="object"!=typeof e||e instanceof Array?e:t,this._member="object"==typeof e?e:null,this.bitfield="number"==typeof t?t:this.constructor.resolve(t)}get member(){return this._member}set member(e){this._member=e}get raw(){return this.bitfield}set raw(e){this.bitfield=e}has(e,t=!0){return e instanceof Array?e.every(e=>this.has(e,t)):(e=this.constructor.resolve(e),!!(t&&(this.bitfield&this.constructor.FLAGS.ADMINISTRATOR)>0)||(this.bitfield&e)===e)}missing(e,t=!0){return e.filter(e=>!this.has(e,t))}add(...e){let t=0;for(let n=0;nthis.resolve(e)).reduce((e,t)=>e|t,0);if("string"==typeof e&&(e=this.FLAGS[e]),"number"!=typeof e||e<1)throw new RangeError(i.Errors.NOT_A_PERMISSION);return e}}r.FLAGS={CREATE_INSTANT_INVITE:1,KICK_MEMBERS:2,BAN_MEMBERS:4,ADMINISTRATOR:8,MANAGE_CHANNELS:16,MANAGE_GUILD:32,ADD_REACTIONS:64,VIEW_AUDIT_LOG:128,READ_MESSAGES:1024,SEND_MESSAGES:2048,SEND_TTS_MESSAGES:4096,MANAGE_MESSAGES:8192,EMBED_LINKS:16384,ATTACH_FILES:32768,READ_MESSAGE_HISTORY:65536,MENTION_EVERYONE:1<<17,EXTERNAL_EMOJIS:1<<18,USE_EXTERNAL_EMOJIS:1<<18,CONNECT:1<<20,SPEAK:1<<21,MUTE_MEMBERS:1<<22,DEAFEN_MEMBERS:1<<23,MOVE_MEMBERS:1<<24,USE_VAD:1<<25,CHANGE_NICKNAME:1<<26,MANAGE_NICKNAMES:1<<27,MANAGE_ROLES:1<<28,MANAGE_ROLES_OR_PERMISSIONS:1<<28,MANAGE_WEBHOOKS:1<<29,MANAGE_EMOJIS:1<<30},r.ALL=Object.keys(r.FLAGS).reduce((e,t)=>e|r.FLAGS[t],0),r.DEFAULT=104324097,r.prototype.hasPermission=s.deprecate(r.prototype.hasPermission,"EvaluatedPermissions#hasPermission is deprecated, use Permissions#has instead"),r.prototype.hasPermissions=s.deprecate(r.prototype.hasPermissions,"EvaluatedPermissions#hasPermissions is deprecated, use Permissions#has instead"),r.prototype.missingPermissions=s.deprecate(r.prototype.missingPermissions,"EvaluatedPermissions#missingPermissions is deprecated, use Permissions#missing instead"),Object.defineProperty(r.prototype,"member",{get:s.deprecate(Object.getOwnPropertyDescriptor(r.prototype,"member").get,"EvaluatedPermissions#member is deprecated")}),e.exports=r},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t){class n{constructor(e={}){this.status=e.status||"offline",this.game=e.game?new i(e.game):null}update(e){this.status=e.status||this.status,this.game=e.game?new i(e.game):null}equals(e){return this===e||(e&&this.status===e.status&&this.game?this.game.equals(e.game):!e.game)}}class i{constructor(e){this.name=e.name,this.type=e.type,this.url=e.url||null}get streaming(){return 1===this.type}equals(e){return this===e||e&&this.name===e.name&&this.type===e.type&&this.url===e.url}}t.Presence=n,t.Game=i},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function s(e){return"number"==typeof e}function r(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!s(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,s,a,c,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||r(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}if(n=this._events[e],o(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(r(n))for(a=Array.prototype.slice.call(arguments,1),u=n.slice(),s=u.length,c=0;c0&&this._events[e].length>s&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),s||(s=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var s=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,s,o,a;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],o=n.length,s=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(r(n)){for(a=o;a-- >0;)if(n[a]===t||n[a].listener&&n[a].listener===t){s=a;break}if(s<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(s,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],i(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){"use strict";function i(e){if(!(this instanceof i))return new i(e);u.call(this,e),l.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",s)}function s(){this.allowHalfOpen||this._writableState.ended||a(r,this)}function r(e){e.end()}var o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=i;var a=n(35),c=n(20);c.inherits=n(10);var u=n(58),l=n(37);c.inherits(i,u);for(var h=o(l.prototype),p=0;pe.roles.has(this.id))}get editable(){if(this.managed)return!1;const e=this.guild.member(this.client.user);return!!e.permissions.has(s.FLAGS.MANAGE_ROLES_OR_PERMISSIONS)&&e.highestRole.comparePositionTo(this)>0}get calculatedPosition(){const e=this.guild._sortedRoles;return e.array().indexOf(e.get(this.id))}serialize(){return new s(this.permissions).serialize()}hasPermission(e,t=!1,n){return new s(this.permissions).has(e,void 0!==n?n:!t)}hasPermissions(e,t=!1){return new s(this.permissions).has(e,!t)}comparePositionTo(e){return this.constructor.comparePositions(this,e)}edit(e){return this.client.rest.methods.updateGuildRole(this,e)}setName(e){return this.edit({name:e})}setColor(e){return this.edit({color:e})}setHoist(e){return this.edit({hoist:e})}setPosition(e,t){return this.guild.setRolePosition(this,e,t).then(()=>this)}setPermissions(e){return this.edit({permissions:e})}setMentionable(e){return this.edit({mentionable:e})}delete(){return this.client.rest.methods.deleteGuildRole(this)}equals(e){return e&&this.id===e.id&&this.name===e.name&&this.color===e.color&&this.hoist===e.hoist&&this.position===e.position&&this.permissions===e.permissions&&this.managed===e.managed}toString(){return this.id===this.guild.id?"@everyone":`<@&${this.id}>`}static comparePositions(e,t){return e.position===t.position?t.id-e.id:e.position-t.position}}o.prototype.hasPermissions=r.deprecate(o.prototype.hasPermissions,"Role#hasPermissions is deprecated - use Role#hasPermission instead, it now takes an array"),e.exports=o},function(e,t,n){const i=n(23),s=n(0),r=n(11).Presence,o=n(7);class a{constructor(e,t){Object.defineProperty(this,"client",{value:e}),t&&this.setup(t)}setup(e){this.id=e.id,this.username=e.username,this.discriminator=e.discriminator,this.avatar=e.avatar,this.bot=Boolean(e.bot),this.lastMessageID=null,this.lastMessage=null}patch(e){for(const t of["id","username","discriminator","avatar","bot"])void 0!==e[t]&&(this[t]=e[t]);e.token&&(this.client.token=e.token)}get createdTimestamp(){return o.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get presence(){if(this.client.presences.has(this.id))return this.client.presences.get(this.id);for(const e of this.client.guilds.values())if(e.presences.has(this.id))return e.presences.get(this.id);return new r}get avatarURL(){return this.avatar?s.Endpoints.User(this).Avatar(this.client.options.http.cdn,this.avatar):null}get defaultAvatarURL(){const e=Object.keys(s.DefaultAvatars),t=e[this.discriminator%e.length];return s.Endpoints.CDN(this.client.options.http.host).Asset(`${s.DefaultAvatars[t]}.png`)}get displayAvatarURL(){return this.avatarURL||this.defaultAvatarURL}get tag(){return`${this.username}#${this.discriminator}`}get note(){return this.client.user.notes.get(this.id)||null}typingIn(e){return e=this.client.resolver.resolveChannel(e),e._typing.has(this.id)}typingSinceIn(e){return e=this.client.resolver.resolveChannel(e),e._typing.has(this.id)?new Date(e._typing.get(this.id).since):null}typingDurationIn(e){return e=this.client.resolver.resolveChannel(e),e._typing.has(this.id)?e._typing.get(this.id).elapsedTime:-1}get dmChannel(){return this.client.channels.filter(e=>"dm"===e.type).find(e=>e.recipient.id===this.id)}createDM(){return this.client.rest.methods.createDM(this)}deleteDM(){return this.client.rest.methods.deleteChannel(this)}addFriend(){return this.client.rest.methods.addFriend(this)}removeFriend(){return this.client.rest.methods.removeFriend(this)}block(){return this.client.rest.methods.blockUser(this)}unblock(){return this.client.rest.methods.unblockUser(this)}fetchProfile(){return this.client.rest.methods.fetchUserProfile(this)}setNote(e){return this.client.rest.methods.setNote(this,e)}equals(e){return e&&this.id===e.id&&this.username===e.username&&this.discriminator===e.discriminator&&this.avatar===e.avatar&&this.bot===Boolean(e.bot)}toString(){return`<@${this.id}>`}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendCode(){}}i.applyToClass(a),e.exports=a},function(e,t,n){const i=n(0),s=n(3),r=n(7);class o{constructor(e,t){Object.defineProperty(this,"client",{value:e.client}),this.guild=e,this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.requiresColons=e.require_colons,this.managed=e.managed,this._roles=e.roles}get createdTimestamp(){return r.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get roles(){const e=new s;for(const t of this._roles)this.guild.roles.has(t)&&e.set(t,this.guild.roles.get(t));return e}get url(){return i.Endpoints.CDN(this.client.options.http.cdn).Emoji(this.id)}get identifier(){return this.id?`${this.name}:${this.id}`:encodeURIComponent(this.name)}edit(e){return this.client.rest.methods.updateEmoji(this,e)}setName(e){return this.edit({name:e})}addRestrictedRole(e){return this.addRestrictedRoles([e])}addRestrictedRoles(e){const t=new s(this.roles);for(const n of e)this.guild.roles.has(n.id)&&t.set(n.id,n);return this.edit({roles:t})}removeRestrictedRole(e){return this.removeRestrictedRoles([e])}removeRestrictedRoles(e){const t=new s(this.roles);for(const n of e)t.has(n.id)&&t.delete(n.id);return this.edit({roles:t})}toString(){return this.requiresColons?`<:${this.name}:${this.id}>`:this.name}equals(e){return e instanceof o?e.id===this.id&&e.name===this.name&&e.managed===this.managed&&e.requiresColons===this.requiresColons:e.id===this.id&&e.name===this.name}}e.exports=o},function(e,t,n){const i=n(23),s=n(15),r=n(9),o=n(3),a=n(11).Presence,c=n(22);class u{constructor(e,t){Object.defineProperty(this,"client",{value:e.client}),this.guild=e,this.user={},this._roles=[],t&&this.setup(t),this.lastMessageID=null,this.lastMessage=null}setup(e){this.serverDeaf=e.deaf,this.serverMute=e.mute,this.selfMute=e.self_mute,this.selfDeaf=e.self_deaf,this.voiceSessionID=e.session_id,this.voiceChannelID=e.channel_id,this.speaking=!1,this.nickname=e.nick||null,this.joinedTimestamp=new Date(e.joined_at).getTime(),this.user=e.user,this._roles=e.roles}get joinedAt(){return new Date(this.joinedTimestamp)}get presence(){return this.frozenPresence||this.guild.presences.get(this.id)||new a}get roles(){const e=new o,t=this.guild.roles.get(this.guild.id);t&&e.set(t.id,t);for(const t of this._roles){const n=this.guild.roles.get(t);n&&e.set(n.id,n)}return e}get highestRole(){return this.roles.reduce((e,t)=>!e||t.comparePositionTo(e)>0?t:e)}get colorRole(){const e=this.roles.filter(e=>e.color);return e.size?e.reduce((e,t)=>!e||t.comparePositionTo(e)>0?t:e):null}get displayColor(){const e=this.colorRole;return e&&e.color||0}get displayHexColor(){const e=this.colorRole;return e&&e.hexColor||"#000000"}get hoistRole(){const e=this.roles.filter(e=>e.hoist);return e.size?e.reduce((e,t)=>!e||t.comparePositionTo(e)>0?t:e):null}get mute(){return this.selfMute||this.serverMute}get deaf(){return this.selfDeaf||this.serverDeaf}get voiceChannel(){return this.guild.channels.get(this.voiceChannelID)}get id(){return this.user.id}get displayName(){return this.nickname||this.user.username}get permissions(){if(this.user.id===this.guild.ownerID)return new r(this,r.ALL);let e=0;const t=this.roles;for(const n of t.values())e|=n.permissions;return new r(this,e)}get kickable(){if(this.user.id===this.guild.ownerID)return!1;if(this.user.id===this.client.user.id)return!1;const e=this.guild.member(this.client.user);return!!e.permissions.has(r.FLAGS.KICK_MEMBERS)&&e.highestRole.comparePositionTo(this.highestRole)>0}get bannable(){if(this.user.id===this.guild.ownerID)return!1;if(this.user.id===this.client.user.id)return!1;const e=this.guild.member(this.client.user);return!!e.permissions.has(r.FLAGS.BAN_MEMBERS)&&e.highestRole.comparePositionTo(this.highestRole)>0}permissionsIn(e){if(!(e=this.client.resolver.resolveChannel(e))||!e.guild)throw new Error("Could not resolve channel to a guild channel.");return e.permissionsFor(this)}hasPermission(e,t=!1,n,i){return void 0===n&&(n=!t),void 0===i&&(i=!t),!(!i||this.user.id!==this.guild.ownerID)||this.roles.some(t=>t.hasPermission(e,void 0,n))}hasPermissions(e,t=!1){return!t&&this.user.id===this.guild.ownerID||this.hasPermission(e,t)}missingPermissions(e,t=!1){return e.missing(e,t)}edit(e){return this.client.rest.methods.updateGuildMember(this,e)}setMute(e){return this.edit({mute:e})}setDeaf(e){return this.edit({deaf:e})}setVoiceChannel(e){return this.edit({channel:e})}setRoles(e){return this.edit({roles:e})}addRole(e){if(e instanceof s||(e=this.guild.roles.get(e)),!e)throw new TypeError("Supplied parameter was neither a Role nor a Snowflake.");return this.client.rest.methods.addMemberRole(this,e)}addRoles(e){let t;if(e instanceof o){t=this._roles.slice();for(const n of e.values())t.push(n.id)}else t=this._roles.concat(e);return this.edit({roles:t})}removeRole(e){if(e instanceof s||(e=this.guild.roles.get(e)),!e)throw new TypeError("Supplied parameter was neither a Role nor a Snowflake.");return this.client.rest.methods.removeMemberRole(this,e)}removeRoles(e){const t=this._roles.slice();if(e instanceof o)for(const n of e.values()){const e=t.indexOf(n.id);e>=0&&t.splice(e,1)}else for(const n of e){const e=t.indexOf(n instanceof s?n.id:n);e>=0&&t.splice(e,1)}return this.edit({roles:t})}setNickname(e){return this.edit({nick:e})}createDM(){return this.user.createDM()}deleteDM(){return this.user.deleteDM()}kick(e){return this.client.rest.methods.kickGuildMember(this.guild,this,e)}ban(e){return this.guild.ban(this,e)}toString(){return`<@${this.nickname?"!":""}${this.user.id}>`}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendCode(){}}i.applyToClass(u),u.prototype.hasPermissions=c.deprecate(u.prototype.hasPermissions,"GuildMember#hasPermissions is deprecated - use GuildMember#hasPermission, it now takes an array"),e.exports=u},function(e,t,n){const i=n(48),s=n(45),r=n(47),o=n(49),a=n(54),c=n(4),u=n(3),l=n(0),h=n(9);let p;class d{constructor(e,t,n){Object.defineProperty(this,"client",{value:n}),this.channel=e,t&&this.setup(t)}setup(e){this.id=e.id,this.type=l.MessageTypes[e.type],this.content=e.content,this.author=this.client.dataManager.newUser(e.author),this.member=this.guild?this.guild.member(this.author)||null:null,this.pinned=e.pinned,this.tts=e.tts,this.nonce=e.nonce,this.system=6===e.type,this.embeds=e.embeds.map(e=>new r(this,e)),this.attachments=new u;for(const t of e.attachments)this.attachments.set(t.id,new s(this,t));if(this.createdTimestamp=new Date(e.timestamp).getTime(),this.editedTimestamp=e.edited_timestamp?new Date(e.edited_timestamp).getTime():null,this.reactions=new u,e.reactions&&e.reactions.length>0)for(const t of e.reactions){const e=t.emoji.id?`${t.emoji.name}:${t.emoji.id}`:t.emoji.name;this.reactions.set(e,new o(this,t.emoji,t.count,t.me))}this.mentions=new i(this,e.mentions,e.mention_roles,e.mention_everyone),this.webhookID=e.webhook_id||null,this.hit="boolean"==typeof e.hit?e.hit:null,this._edits=[]}patch(e){const t=c.cloneObject(this);if(this._edits.unshift(t),this.editedTimestamp=new Date(e.edited_timestamp).getTime(),"content"in e&&(this.content=e.content),"pinned"in e&&(this.pinned=e.pinned),"tts"in e&&(this.tts=e.tts),this.embeds="embeds"in e?e.embeds.map(e=>new r(this,e)):this.embeds.slice(),"attachments"in e){this.attachments=new u;for(const t of e.attachments)this.attachments.set(t.id,new s(this,t))}else this.attachments=new u(this.attachments);this.mentions=new i(this,"mentions"in e?e.mentions:this.mentions.users,"mentions_roles"in e?e.mentions_roles:this.mentions.roles,"mention_everyone"in e?e.mention_everyone:this.mentions.everyone)}get createdAt(){return new Date(this.createdTimestamp)}get editedAt(){return this.editedTimestamp?new Date(this.editedTimestamp):null}get guild(){return this.channel.guild||null}get cleanContent(){return this.content.replace(/@(everyone|here)/g,"@​$1").replace(/<@!?[0-9]+>/g,e=>{const t=e.replace(/<|!|>|@/g,"");if("dm"===this.channel.type||"group"===this.channel.type)return this.client.users.has(t)?`@${this.client.users.get(t).username}`:e;const n=this.channel.guild.members.get(t);if(n)return n.nickname?`@${n.nickname}`:`@${n.user.username}`;{const n=this.client.users.get(t);return n?`@${n.username}`:e}}).replace(/<#[0-9]+>/g,e=>{const t=this.client.channels.get(e.replace(/<|#|>/g,""));if(t)return`#${t.name}`;return e}).replace(/<@&[0-9]+>/g,e=>{if("dm"===this.channel.type||"group"===this.channel.type)return e;const t=this.guild.roles.get(e.replace(/<|@|>|&/g,""));if(t)return`@${t.name}`;return e})}createReactionCollector(e,t={}){return new a(this,e,t)}awaitReactions(e,t={}){return new Promise((n,i)=>{const s=this.createReactionCollector(e,t);s.once("end",(e,s)=>{t.errors&&t.errors.includes(s)?i(e):n(e)})})}get edits(){const e=this._edits.slice();return e.unshift(this),e}get editable(){return this.author.id===this.client.user.id}get deletable(){return this.author.id===this.client.user.id||this.guild&&this.channel.permissionsFor(this.client.user).has(h.FLAGS.MANAGE_MESSAGES)}get pinnable(){return!this.guild||this.channel.permissionsFor(this.client.user).has(h.FLAGS.MANAGE_MESSAGES)}isMentioned(e){return e=e&&e.id?e.id:e,this.mentions.users.has(e)||this.mentions.channels.has(e)||this.mentions.roles.has(e)}isMemberMentioned(e){return p||(p=n(18)),!!this.mentions.everyone||(!!this.mentions.users.has(e.id)||!!(e instanceof p&&e.roles.some(e=>this.mentions.roles.has(e.id))))}edit(e,t){return t||"object"!=typeof e||e instanceof Array?t||(t={}):(t=e,e=""),this.client.rest.methods.updateMessage(this,e,t)}editCode(e,t){return t=c.escapeMarkdown(this.client.resolver.resolveString(t),!0),this.edit(`\`\`\`${e||""} ${t} -\`\`\``)}pin(){return this.client.rest.methods.pinMessage(this)}unpin(){return this.client.rest.methods.unpinMessage(this)}react(e){if(!(e=this.client.resolver.resolveEmojiIdentifier(e)))throw new TypeError("Emoji must be a string or Emoji/ReactionEmoji");return this.client.rest.methods.addMessageReaction(this,e)}clearReactions(){return this.client.rest.methods.removeMessageReactions(this)}delete(e=0){return e<=0?this.client.rest.methods.deleteMessage(this):new Promise(t=>{this.client.setTimeout(()=>{t(this.delete())},e)})}reply(e,t){return t||"object"!=typeof e||e instanceof Array?t||(t={}):(t=e,e=""),this.channel.send(e,Object.assign(t,{reply:this.member||this.author}))}acknowledge(){return this.client.rest.methods.ackMessage(this)}fetchWebhook(){return this.webhookID?this.client.fetchWebhook(this.webhookID):Promise.reject(new Error("The message was not sent by a webhook."))}equals(e,t){if(!e)return!1;if(!e.author&&!e.attachments)return this.id===e.id&&this.embeds.length===e.embeds.length;let n=this.id===e.id&&this.author.id===e.author.id&&this.content===e.content&&this.tts===e.tts&&this.nonce===e.nonce&&this.embeds.length===e.embeds.length&&this.attachments.length===e.attachments.length;return n&&t&&(n=this.mentions.everyone===e.mentions.everyone&&this.createdTimestamp===new Date(t.timestamp).getTime()&&this.editedTimestamp===new Date(t.edited_timestamp).getTime()),n}toString(){return this.content}_addReaction(e,t){const n=e.id?`${e.name}:${e.id}`:encodeURIComponent(e.name);let i;return this.reactions.has(n)?(i=this.reactions.get(n),i.me||(i.me=t.id===this.client.user.id)):(i=new o(this,e,0,t.id===this.client.user.id),this.reactions.set(n,i)),i.users.has(t.id)||i.users.set(t.id,t),i.count++,i}_removeReaction(e,t){const n=e.id?`${e.name}:${e.id}`:encodeURIComponent(e.name);if(this.reactions.has(n)){const e=this.reactions.get(n);if(e.users.has(t.id))return e.users.delete(t.id),e.count--,t.id===this.client.user.id&&(e.me=!1),e.count<=0&&this.reactions.delete(n),e}return null}_clearReactions(){this.reactions.clear()}}e.exports=d},function(e,t,n){(function(e){function n(e){return Array.isArray?Array.isArray(e):"[object Array]"===g(e)}function i(e){return"boolean"==typeof e}function s(e){return null===e}function r(e){return null==e}function o(e){return"number"==typeof e}function a(e){return"string"==typeof e}function c(e){return"symbol"==typeof e}function u(e){return void 0===e}function l(e){return"[object RegExp]"===g(e)}function h(e){return"object"==typeof e&&null!==e}function p(e){return"[object Date]"===g(e)}function d(e){return"[object Error]"===g(e)||e instanceof Error}function f(e){return"function"==typeof e}function m(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function g(e){return Object.prototype.toString.call(e)}t.isArray=n,t.isBoolean=i,t.isNull=s,t.isNullOrUndefined=r,t.isNumber=o,t.isString=a,t.isSymbol=c,t.isUndefined=u,t.isRegExp=l,t.isObject=h,t.isDate=p,t.isError=d,t.isFunction=f,t.isPrimitive=m,t.isBuffer=e.isBuffer}).call(t,n(5).Buffer)},function(e,t,n){t=e.exports=n(58),t.Stream=t,t.Readable=t,t.Writable=n(37),t.Duplex=n(13),t.Transform=n(59),t.PassThrough=n(84)},function(e,t,n){(function(e,i){function s(e,n){var i={seen:[],stylize:o};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),m(n)?i.showHidden=n:n&&t._extend(i,n),y(i.showHidden)&&(i.showHidden=!1),y(i.depth)&&(i.depth=2),y(i.colors)&&(i.colors=!1),y(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=r),c(i,e,i.depth)}function r(e,t){var n=s.styles[t];return n?"["+s.colors[n][0]+"m"+e+"["+s.colors[n][1]+"m":e}function o(e,t){return e}function a(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function c(e,n,i){if(e.customInspect&&n&&T(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var s=n.inspect(i,e);return b(s)||(s=c(e,s,i)),s}var r=u(e,n);if(r)return r;var o=Object.keys(n),m=a(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(n)),A(n)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(n);if(0===o.length){if(T(n)){var g=n.name?": "+n.name:"";return e.stylize("[Function"+g+"]","special")}if(_(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(R(n))return e.stylize(Date.prototype.toString.call(n),"date");if(A(n))return l(n)}var v="",E=!1,w=["{","}"];if(f(n)&&(E=!0,w=["[","]"]),T(n)){v=" [Function"+(n.name?": "+n.name:"")+"]"}if(_(n)&&(v=" "+RegExp.prototype.toString.call(n)),R(n)&&(v=" "+Date.prototype.toUTCString.call(n)),A(n)&&(v=" "+l(n)),0===o.length&&(!E||0==n.length))return w[0]+v+w[1];if(i<0)return _(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special");e.seen.push(n);var y;return y=E?h(e,n,i,m,o):o.map(function(t){return p(e,n,i,m,t,E)}),e.seen.pop(),d(y,v,w)}function u(e,t){if(y(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return E(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,i,s){for(var r=[],o=0,a=t.length;o-1&&(a=r?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),y(o)){if(r&&s.match(/^\d+$/))return a;o=JSON.stringify(""+s),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+a}function d(e,t,n){var i=0;return e.reduce(function(e,t){return i++,t.indexOf("\n")>=0&&i++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function f(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function g(e){return null===e}function v(e){return null==e}function E(e){return"number"==typeof e}function b(e){return"string"==typeof e}function w(e){return"symbol"==typeof e}function y(e){return void 0===e}function _(e){return x(e)&&"[object RegExp]"===S(e)}function x(e){return"object"==typeof e&&null!==e}function R(e){return x(e)&&"[object Date]"===S(e)}function A(e){return x(e)&&("[object Error]"===S(e)||e instanceof Error)}function T(e){return"function"==typeof e}function k(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function S(e){return Object.prototype.toString.call(e)}function D(e){return e<10?"0"+e.toString(10):e.toString(10)}function M(){var e=new Date,t=[D(e.getHours()),D(e.getMinutes()),D(e.getSeconds())].join(":");return[e.getDate(),U[e.getMonth()],t].join(" ")}function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.format=function(e){if(!b(e)){for(var t=[],n=0;n=r)return e;switch(e){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(e){return"[Circular]"}default:return e}}),a=i[n];nthis.client.resolver.resolveBuffer(e.attachment).then(t=>{e.file=t;return e}))).then(n=>this.client.rest.methods.sendMessage(this,e,t,n))}return this.client.rest.methods.sendMessage(this,e,t)}fetchMessage(e){return this.client.user.bot?this.client.rest.methods.getChannelMessage(this,e).then(e=>{const t=e instanceof s?e:new s(this,e,this.client);this._cacheMessage(t);return t}):this.fetchMessages({limit:1,around:e}).then(t=>{const n=t.get(e);if(!n)throw new Error("Message not found.");return n})}fetchMessages(e={}){return this.client.rest.methods.getChannelMessages(this,e).then(e=>{const t=new o;for(const n of e){const e=new s(this,n,this.client);t.set(n.id,e),this._cacheMessage(e)}return t})}fetchPinnedMessages(){return this.client.rest.methods.getChannelPinnedMessages(this).then(e=>{const t=new o;for(const n of e){const e=new s(this,n,this.client);t.set(n.id,e),this._cacheMessage(e)}return t})}search(e={}){return this.client.rest.methods.search(this,e)}startTyping(e){if(void 0!==e&&e<1)throw new RangeError("Count must be at least 1.");if(this.client.user._typing.has(this.id)){const t=this.client.user._typing.get(this.id);t.count=e||t.count+1}else this.client.user._typing.set(this.id,{count:e||1,interval:this.client.setInterval(()=>{this.client.rest.methods.sendTyping(this.id)},9e3)}),this.client.rest.methods.sendTyping(this.id)}stopTyping(e=!1){if(this.client.user._typing.has(this.id)){const t=this.client.user._typing.get(this.id);t.count--,(t.count<=0||e)&&(this.client.clearInterval(t.interval),this.client.user._typing.delete(this.id))}}get typing(){return this.client.user._typing.has(this.id)}get typingCount(){return this.client.user._typing.has(this.id)?this.client.user._typing.get(this.id).count:0}createCollector(e,t){return this.createMessageCollector(e,t)}createMessageCollector(e,t={}){return new r(this,e,t)}awaitMessages(e,t={}){return new Promise((n,i)=>{const s=this.createCollector(e,t);s.once("end",(e,s)=>{t.errors&&t.errors.includes(s)?i(e):n(e)})})}bulkDelete(e,t=!1){if(!isNaN(e))return this.fetchMessages({limit:e}).then(e=>this.bulkDelete(e,t));if(e instanceof Array||e instanceof o){const n=e instanceof o?e.keyArray():e.map(e=>e.id);return this.client.rest.methods.bulkDeleteMessages(this,n,t)}throw new TypeError("The messages must be an Array, Collection, or number.")}acknowledge(){return this.lastMessageID?this.client.rest.methods.ackTextChannel(this):Promise.resolve(this)}_cacheMessage(e){const t=this.client.options.messageCacheMaxSize;return 0===t?null:(this.messages.size>=t&&t>0&&this.messages.delete(this.messages.firstKey()),this.messages.set(e.id,e),e)}}const u={sendMessage(e,t){return this.send(e,t)},sendEmbed(e,t,n){return n||"object"!=typeof t||t instanceof Array?n||(n={}):(n=t,t=""),this.send(t,Object.assign(n,{embed:e}))},sendFiles(e,t,n={}){return this.send(t,Object.assign(n,{files:e}))},sendFile(e,t,n,i={}){return this.send({files:[{attachment:e,name:t}],content:n,options:i})},sendCode(e,t,n={}){return this.send(t,Object.assign(n,{code:e}))}};for(const e of Object.keys(u))c.prototype[e]=a.deprecate(u[e],`TextChannel#${e}: use TextChannel#send instead`);t.applyToClass=((e,t=!1,n=[])=>{const i=["send","sendMessage","sendEmbed","sendFile","sendFiles","sendCode"];t&&i.push("_cacheMessage","acknowledge","fetchMessages","fetchMessage","search","bulkDelete","startTyping","stopTyping","typing","typingCount","fetchPinnedMessages","createCollector","createMessageCollector","awaitMessages");for(const t of i)n.includes(t)||Object.defineProperty(e.prototype,t,Object.getOwnPropertyDescriptor(c.prototype,t))})},function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!=typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n"},function(e,t,n){const i=n(34),s=n(16),r=n(15),o=n(17),a=n(11).Presence,c=n(18),u=n(0),l=n(3),h=n(4),p=n(7);class d{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.members=new l,this.channels=new l,this.roles=new l,this.presences=new l,t&&(t.unavailable?(this.available=!1,this.id=t.id):(this.available=!0,this.setup(t)))}setup(e){if(this.name=e.name,this.icon=e.icon,this.splash=e.splash,this.region=e.region,this.memberCount=e.member_count||this.memberCount,this.large=Boolean("large"in e?e.large:this.large),this.features=e.features,this.applicationID=e.application_id,this.afkTimeout=e.afk_timeout,this.afkChannelID=e.afk_channel_id,this.embedEnabled=e.embed_enabled,this.verificationLevel=e.verification_level,this.explicitContentFilter=e.explicit_content_filter,this.joinedTimestamp=e.joined_at?new Date(e.joined_at).getTime():this.joinedTimestamp,this.id=e.id,this.available=!e.unavailable,this.features=e.features||this.features||[],e.members){this.members.clear();for(const t of e.members)this._addMember(t,!1)}if(e.owner_id&&(this.ownerID=e.owner_id),e.channels){this.channels.clear();for(const t of e.channels)this.client.dataManager.newChannel(t,this)}if(e.roles){this.roles.clear();for(const t of e.roles){const e=new r(this,t);this.roles.set(e.id,e)}}if(e.presences)for(const t of e.presences)this._setPresence(t.user.id,t);if(this._rawVoiceStates=new l,e.voice_states)for(const t of e.voice_states){this._rawVoiceStates.set(t.user_id,t);const e=this.members.get(t.user_id);e&&(e.serverMute=t.mute,e.serverDeaf=t.deaf,e.selfMute=t.self_mute,e.selfDeaf=t.self_deaf,e.voiceSessionID=t.session_id,e.voiceChannelID=t.channel_id,this.channels.get(t.channel_id).members.set(e.user.id,e))}if(this.emojis)this.client.actions.GuildEmojisUpdate.handle({guild_id:this.id,emojis:e.emojis});else{this.emojis=new l;for(const t of e.emojis)this.emojis.set(t.id,new o(this,t))}}get createdTimestamp(){return p.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get joinedAt(){return new Date(this.joinedTimestamp)}get iconURL(){return this.icon?u.Endpoints.Guild(this).Icon(this.client.options.http.cdn,this.icon):null}get splashURL(){return this.splash?u.Endpoints.Guild(this).Splash(this.client.options.http.cdn,this.splash):null}get owner(){return this.members.get(this.ownerID)}get voiceConnection(){return this.client.browser?null:this.client.voice.connections.get(this.id)||null}get defaultChannel(){return this.channels.get(this.id)}get position(){return this.client.user.bot?null:this.client.user.settings.guildPositions?this.client.user.settings.guildPositions.indexOf(this.id):null}get defaultRole(){return this.roles.get(this.id)}get me(){return this.members.get(this.client.user.id)}get _sortedRoles(){return this._sortPositionWithID(this.roles)}member(e){return this.client.resolver.resolveGuildMember(this,e)}fetchBans(){return this.client.rest.methods.getGuildBans(this).then(e=>{const t=new l;for(const n of e.values())t.set(n.user.id,n.user);return t})}fetchInvites(){return this.client.rest.methods.getGuildInvites(this)}fetchWebhooks(){return this.client.rest.methods.getGuildWebhooks(this)}fetchVoiceRegions(){return this.client.rest.methods.fetchVoiceRegions(this.id)}fetchAuditLogs(e){return this.client.rest.methods.getGuildAuditLogs(this,e)}addMember(e,t){return this.members.has(e.id)?Promise.resolve(this.members.get(e.id)):this.client.rest.methods.putGuildMember(this,e,t)}fetchMember(e,t=!0){return e=this.client.resolver.resolveUser(e),e?this.members.has(e.id)?Promise.resolve(this.members.get(e.id)):this.client.rest.methods.getGuildMember(this,e,t):Promise.reject(new Error("User is not cached. Use Client.fetchUser first."))}fetchMembers(e="",t=0){return new Promise((n,i)=>{if(this.memberCount===this.members.size)return void n(this);this.client.ws.send({op:u.OPCodes.REQUEST_GUILD_MEMBERS,d:{guild_id:this.id,query:e,limit:t}});const s=(e,t)=>{if(t.id!==this.id)return;(this.memberCount===this.members.size||e.length<1e3)&&(this.client.removeListener(u.Events.GUILD_MEMBERS_CHUNK,s),n(this))};this.client.on(u.Events.GUILD_MEMBERS_CHUNK,s);this.client.setTimeout(()=>i(new Error("Members didn't arrive in time.")),12e4)})}search(e={}){return this.client.rest.methods.search(this,e)}edit(e){return this.client.rest.methods.updateGuild(this,e)}setName(e){return this.edit({name:e})}setRegion(e){return this.edit({region:e})}setVerificationLevel(e){return this.edit({verificationLevel:e})}setAFKChannel(e){return this.edit({afkChannel:e})}setAFKTimeout(e){return this.edit({afkTimeout:e})}setIcon(e){return this.edit({icon:e})}setOwner(e){return this.edit({owner:e})}setSplash(e){return this.edit({splash:e})}setPosition(e,t){return this.client.user.bot?Promise.reject(new Error("Setting guild position is only available for user accounts")):this.client.user.settings.setGuildPosition(this,e,t)}acknowledge(){return this.client.rest.methods.ackGuild(this)}allowDMs(e){const t=this.client.user.settings;return e?t.removeRestrictedGuild(this):t.addRestrictedGuild(this)}ban(e,t={}){return"number"==typeof t?t={reason:null,days:t}:"string"==typeof t&&(t={reason:t,days:0}),this.client.rest.methods.banGuildMember(this,e,t)}unban(e){return this.client.rest.methods.unbanGuildMember(this,e)}pruneMembers(e,t=!1){if("number"!=typeof e)throw new TypeError("Days must be a number.");return this.client.rest.methods.pruneGuildMembers(this,e,t)}sync(){this.client.user.bot||this.client.syncGuilds([this])}createChannel(e,t,n){return this.client.rest.methods.createChannel(this,e,t,n)}setChannelPositions(e){return this.client.rest.methods.updateChannelPositions(this.id,e)}createRole(e={}){return this.client.rest.methods.createGuildRole(this,e)}createEmoji(e,t,n){return new Promise(i=>{"string"==typeof e&&e.startsWith("data:")?i(this.client.rest.methods.createEmoji(this,e,t,n)):this.client.resolver.resolveBuffer(e).then(e=>{const s=this.client.resolver.resolveBase64(e);i(this.client.rest.methods.createEmoji(this,s,t,n))})})}deleteEmoji(e){return e instanceof o||(e=this.emojis.get(e)),this.client.rest.methods.deleteEmoji(e)}leave(){return this.client.rest.methods.leaveGuild(this)}delete(){return this.client.rest.methods.deleteGuild(this)}equals(e){let t=e&&this.id===e.id&&this.available===!e.unavailable&&this.splash===e.splash&&this.region===e.region&&this.name===e.name&&this.memberCount===e.member_count&&this.large===e.large&&this.icon===e.icon&&h.arraysEqual(this.features,e.features)&&this.ownerID===e.owner_id&&this.verificationLevel===e.verification_level&&this.embedEnabled===e.embed_enabled;return t&&(this.embedChannel?this.embedChannel.id!==e.embed_channel_id&&(t=!1):e.embed_channel_id&&(t=!1)),t}toString(){return this.name}_addMember(e,t=!0){const n=this.members.has(e.user.id);e.user instanceof s||(e.user=this.client.dataManager.newUser(e.user)),e.joined_at=e.joined_at||0;const i=new c(this,e);if(this.members.set(i.id,i),this._rawVoiceStates&&this._rawVoiceStates.has(i.user.id)){const e=this._rawVoiceStates.get(i.user.id);i.serverMute=e.mute,i.serverDeaf=e.deaf,i.selfMute=e.self_mute,i.selfDeaf=e.self_deaf,i.voiceSessionID=e.session_id,i.voiceChannelID=e.channel_id,this.client.channels.has(e.channel_id)?this.client.channels.get(e.channel_id).members.set(i.user.id,i):this.client.emit("warn",`Member ${i.id} added in guild ${this.id} with an uncached voice channel`)}return this.client.ws.connection.status===u.Status.READY&&t&&!n&&this.client.emit(u.Events.GUILD_MEMBER_ADD,i),i}_updateMember(e,t){const n=h.cloneObject(e);t.roles&&(e._roles=t.roles),void 0!==t.nick&&(e.nickname=t.nick);const i=e.nickname!==n.nickname||!h.arraysEqual(e._roles,n._roles);return this.client.ws.connection.status===u.Status.READY&&i&&this.client.emit(u.Events.GUILD_MEMBER_UPDATE,n,e),{old:n,mem:e}}_removeMember(e){this.members.delete(e.id)}_memberSpeakUpdate(e,t){const n=this.members.get(e);n&&n.speaking!==t&&(n.speaking=t,this.client.emit(u.Events.GUILD_MEMBER_SPEAKING,n,t))}_setPresence(e,t){if(this.presences.get(e))return void this.presences.get(e).update(t);this.presences.set(e,new a(t))}setRolePosition(e,t,n=!1){if("string"==typeof e&&!(e=this.roles.get(e)))return Promise.reject(new Error("Supplied role is not a role or snowflake."));if(t=Number(t),isNaN(t))return Promise.reject(new Error("Supplied position is not a number."));let i=this._sortedRoles.array();return h.moveElementInArray(i,e,t,n),i=i.map((e,t)=>({id:e.id,position:t})),this.client.rest.methods.setRolePositions(this.id,i)}setChannelPosition(e,t,n=!1){if("string"==typeof e&&!(e=this.channels.get(e)))return Promise.reject(new Error("Supplied channel is not a channel or snowflake."));if(t=Number(t),isNaN(t))return Promise.reject(new Error("Supplied position is not a number."));let i=this._sortedChannels(e.type).array();return h.moveElementInArray(i,e,t,n),i=i.map((e,t)=>({id:e.id,position:t})),this.client.rest.methods.setChannelPositions(this.id,i)}_sortedChannels(e){return this._sortPositionWithID(this.channels.filter(t=>"voice"===e&&"voice"===t.type||("voice"!==e&&"voice"!==t.type||e===t.type)))}_sortPositionWithID(e){return e.sort((e,t)=>e.position!==t.position?e.position-t.position:i.fromString(e.id).sub(i.fromString(t.id)).toNumber())}}e.exports=d},function(e,t,n){const i=n(14),s=n(15),r=n(53),o=n(9),a=n(3);class c extends i{constructor(e,t){super(e.client,t),this.guild=e}setup(e){if(super.setup(e),this.name=e.name,this.position=e.position,this.permissionOverwrites=new a,e.permission_overwrites)for(const t of e.permission_overwrites)this.permissionOverwrites.set(t.id,new r(this,t))}get calculatedPosition(){const e=this.guild._sortedChannels(this.type);return e.array().indexOf(e.get(this.id))}permissionsFor(e){if(!(e=this.client.resolver.resolveGuildMember(this.guild,e)))return null;if(e.id===this.guild.ownerID)return new o(e,o.ALL);let t=0;const n=e.roles;for(const e of n.values())t|=e.permissions;const i=this.overwritesFor(e,!0,n);i.everyone&&(t&=~i.everyone.deny,t|=i.everyone.allow);let s=0;for(const e of i.roles)t&=~e.deny,s|=e.allow;return t|=s,i.member&&(t&=~i.member.deny,t|=i.member.allow),Boolean(t&o.FLAGS.ADMINISTRATOR)&&(t=o.ALL),new o(e,t)}overwritesFor(e,t=!1,n=null){if(t||(e=this.client.resolver.resolveGuildMember(this.guild,e)),!e)return[];n=n||e.roles;const i=[];let s,r;for(const t of this.permissionOverwrites.values())t.id===this.guild.id?r=t:n.has(t.id)?i.push(t):t.id===e.id&&(s=t);return{everyone:r,roles:i,member:s}}overwritePermissions(e,t){const n={allow:0,deny:0};if(e instanceof s)n.type="role";else if(this.guild.roles.has(e))e=this.guild.roles.get(e),n.type="role";else if(e=this.client.resolver.resolveUser(e),n.type="member",!e)return Promise.reject(new TypeError("Supplied parameter was neither a User nor a Role."));n.id=e.id;const i=this.permissionOverwrites.get(e.id);i&&(n.allow=i.allow,n.deny=i.deny);for(const e in t)!0===t[e]?(n.allow|=o.FLAGS[e]||0,n.deny&=~(o.FLAGS[e]||0)):!1===t[e]?(n.allow&=~(o.FLAGS[e]||0),n.deny|=o.FLAGS[e]||0):null===t[e]&&(n.allow&=~(o.FLAGS[e]||0),n.deny&=~(o.FLAGS[e]||0));return this.client.rest.methods.setChannelOverwrite(this,n)}edit(e){return this.client.rest.methods.updateChannel(this,e)}setName(e){return this.edit({name:e})}setPosition(e,t){return this.guild.setChannelPosition(this,e,t).then(()=>this)}setTopic(e){return this.client.rest.methods.updateChannel(this,{topic:e})}createInvite(e={}){return this.client.rest.methods.createChannelInvite(this,e)}clone(e=this.name,t=!0,n=!0){return this.guild.createChannel(e,this.type,t?this.permissionOverwrites:[]).then(e=>n?e.setTopic(this.topic):e)}equals(e){let t=e&&this.id===e.id&&this.type===e.type&&this.topic===e.topic&&this.position===e.position&&this.name===e.name;return t&&(t=this.permissionOverwrites&&e.permissionOverwrites?this.permissionOverwrites.equals(e.permissionOverwrites):!this.permissionOverwrites&&!e.permissionOverwrites),t}get deletable(){return this.id!==this.guild.id&&this.permissionsFor(this.client.user).has(o.FLAGS.MANAGE_CHANNELS)}toString(){return`<#${this.id}>`}}e.exports=c},function(e,t,n){(function(e){function n(e,t){for(var n=0,i=e.length-1;i>=0;i--){var s=e[i];"."===s?e.splice(i,1):".."===s?(e.splice(i,1),n++):n&&(e.splice(i,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function i(e,t){if(e.filter)return e.filter(t);for(var n=[],i=0;i=-1&&!s;r--){var o=r>=0?arguments[r]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(t=o+"/"+t,s="/"===o.charAt(0))}return t=n(i(t.split("/"),function(e){return!!e}),!s).join("/"),(s?"/":"")+t||"."},t.normalize=function(e){var s=t.isAbsolute(e),r="/"===o(e,-1);return e=n(i(e.split("/"),function(e){return!!e}),!s).join("/"),e||s||(e="."),e&&r&&(e+="/"),(s?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(i(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function i(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var s=i(e.split("/")),r=i(n.split("/")),o=Math.min(s.length,r.length),a=o,c=0;c[e.id,e.nick]))),this.recipients||(this.recipients=new r),e.recipients)for(const t of e.recipients){const e=this.client.dataManager.newUser(t);this.recipients.set(e.id,e)}this.lastMessageID=e.last_message_id}get owner(){return this.client.users.get(this.ownerID)}equals(e){const t=e&&this.id===e.id&&this.name===e.name&&this.icon===e.icon&&this.ownerID===e.ownerID;return t?this.recipients.equals(e.recipients):t}addUser(e,t){return this.client.rest.methods.addUserToGroupDM(this,{nick:t,id:this.client.resolver.resolveUserID(e),accessToken:e})}toString(){return this.name}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendFiles(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}acknowledge(){}_cacheMessage(){}}s.applyToClass(o,!0,["bulkDelete"]),e.exports=o},function(e,t){class n{constructor(e,t,n){this.reaction=e,this.name=t,this.id=n}get identifier(){return this.id?`${this.name}:${this.id}`:encodeURIComponent(this.name)}toString(){return this.id?`<:${this.name}:${this.id}>`:this.name}}e.exports=n},function(e,t,n){const i=n(27);class s{constructor(e,t,n){e?(Object.defineProperty(this,"client",{value:e}),t&&this.setup(t)):(this.id=t,this.token=n,Object.defineProperty(this,"client",{value:this}))}setup(e){this.name=e.name,this.token=e.token,this.avatar=e.avatar,this.id=e.id,this.guildID=e.guild_id,this.channelID=e.channel_id,e.user?this.owner=this.client.users?this.client.users.get(e.user.id):e.user:this.owner=null}send(e,t){return t||"object"!=typeof e||e instanceof Array?t||(t={}):(t=e,e=""),t.file?("string"==typeof t.file&&(t.file={attachment:t.file}),t.file.name||("string"==typeof t.file.attachment?t.file.name=i.basename(t.file.attachment):t.file.attachment&&t.file.attachment.path?t.file.name=i.basename(t.file.attachment.path):t.file.name="file.jpg"),this.client.resolver.resolveBuffer(t.file.attachment).then(n=>this.client.rest.methods.sendWebhookMessage(this,e,t,{file:n,name:t.file.name}))):this.client.rest.methods.sendWebhookMessage(this,e,t)}sendMessage(e,t={}){return this.send(e,t)}sendFile(e,t,n,i={}){return this.send(n,Object.assign(i,{file:{attachment:e,name:t}}))}sendCode(e,t,n={}){return this.send(t,Object.assign(n,{code:e}))}sendSlackMessage(e){return this.client.rest.methods.sendSlackWebhookMessage(this,e)}edit(e=this.name,t){return t?this.client.resolver.resolveBuffer(t).then(t=>{const n=this.client.resolver.resolveBase64(t);return this.client.rest.methods.editWebhook(this,e,n)}):this.client.rest.methods.editWebhook(this,e).then(e=>{this.setup(e);return this})}delete(){return this.client.rest.methods.deleteWebhook(this)}}e.exports=s},function(e,t,n){const i=n(3),s=n(12).EventEmitter;class r extends s{constructor(e,t,n={}){super(),Object.defineProperty(this,"client",{value: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(e,t,n){"use strict";(function(e){var i=n(5),s=i.Buffer,r=i.SlowBuffer,o=i.kMaxLength||2147483647;t.alloc=function(e,t,n){if("function"==typeof s.alloc)return s.alloc(e,t,n);if("number"==typeof n)throw new TypeError("encoding must not be number");if("number"!=typeof e)throw new TypeError("size must be a number");if(e>o)throw new RangeError("size is too large");var i=n,r=t;void 0===r&&(i=void 0,r=0);var a=new s(e);if("string"==typeof r)for(var c=new s(r,i),u=c.length,l=-1;++lo)throw new RangeError("size is too large");return new s(e)},t.from=function(t,n,i){if("function"==typeof s.from&&(!e.Uint8Array||Uint8Array.from!==s.from))return s.from(t,n,i);if("number"==typeof t)throw new TypeError('"value" argument must not be a number');if("string"==typeof t)return new s(t,n);if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer){var r=n;if(1===arguments.length)return new s(t);void 0===r&&(r=0);var o=i;if(void 0===o&&(o=t.byteLength-r),r>=t.byteLength)throw new RangeError("'offset' is out of bounds");if(o>t.byteLength-r)throw new RangeError("'length' is out of bounds");return new s(t.slice(r,r+o))}if(s.isBuffer(t)){var a=new s(t.length);return t.copy(a,0,0,t.length),a}if(t){if(Array.isArray(t)||"undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return new s(t);if("Buffer"===t.type&&Array.isArray(t.data))return new s(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},t.allocUnsafeSlow=function(e){if("function"==typeof s.allocUnsafeSlow)return s.allocUnsafeSlow(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>=o)throw new RangeError("size is too large");return new r(e)}}).call(t,n(8))},function(e,t,n){var i,s,r;/** +\`\`\``)}pin(){return this.client.rest.methods.pinMessage(this)}unpin(){return this.client.rest.methods.unpinMessage(this)}react(e){if(!(e=this.client.resolver.resolveEmojiIdentifier(e)))throw new TypeError("Emoji must be a string or Emoji/ReactionEmoji");return this.client.rest.methods.addMessageReaction(this,e)}clearReactions(){return this.client.rest.methods.removeMessageReactions(this)}delete(e=0){return e<=0?this.client.rest.methods.deleteMessage(this):new Promise(t=>{this.client.setTimeout(()=>{t(this.delete())},e)})}reply(e,t){return t||"object"!=typeof e||e instanceof Array?t||(t={}):(t=e,e=""),this.channel.send(e,Object.assign(t,{reply:this.member||this.author}))}acknowledge(){return this.client.rest.methods.ackMessage(this)}fetchWebhook(){return this.webhookID?this.client.fetchWebhook(this.webhookID):Promise.reject(new Error("The message was not sent by a webhook."))}equals(e,t){if(!e)return!1;if(!e.author&&!e.attachments)return this.id===e.id&&this.embeds.length===e.embeds.length;let n=this.id===e.id&&this.author.id===e.author.id&&this.content===e.content&&this.tts===e.tts&&this.nonce===e.nonce&&this.embeds.length===e.embeds.length&&this.attachments.length===e.attachments.length;return n&&t&&(n=this.mentions.everyone===e.mentions.everyone&&this.createdTimestamp===new Date(t.timestamp).getTime()&&this.editedTimestamp===new Date(t.edited_timestamp).getTime()),n}toString(){return this.content}_addReaction(e,t){const n=e.id?`${e.name}:${e.id}`:encodeURIComponent(e.name);let i;return this.reactions.has(n)?(i=this.reactions.get(n),i.me||(i.me=t.id===this.client.user.id)):(i=new o(this,e,0,t.id===this.client.user.id),this.reactions.set(n,i)),i.users.has(t.id)||i.users.set(t.id,t),i.count++,i}_removeReaction(e,t){const n=e.id?`${e.name}:${e.id}`:encodeURIComponent(e.name);if(this.reactions.has(n)){const e=this.reactions.get(n);if(e.users.has(t.id))return e.users.delete(t.id),e.count--,t.id===this.client.user.id&&(e.me=!1),e.count<=0&&this.reactions.delete(n),e}return null}_clearReactions(){this.reactions.clear()}}e.exports=d},function(e,t,n){(function(e){function n(e){return Array.isArray?Array.isArray(e):"[object Array]"===g(e)}function i(e){return"boolean"==typeof e}function s(e){return null===e}function r(e){return null==e}function o(e){return"number"==typeof e}function a(e){return"string"==typeof e}function c(e){return"symbol"==typeof e}function u(e){return void 0===e}function l(e){return"[object RegExp]"===g(e)}function h(e){return"object"==typeof e&&null!==e}function p(e){return"[object Date]"===g(e)}function d(e){return"[object Error]"===g(e)||e instanceof Error}function f(e){return"function"==typeof e}function m(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function g(e){return Object.prototype.toString.call(e)}t.isArray=n,t.isBoolean=i,t.isNull=s,t.isNullOrUndefined=r,t.isNumber=o,t.isString=a,t.isSymbol=c,t.isUndefined=u,t.isRegExp=l,t.isObject=h,t.isDate=p,t.isError=d,t.isFunction=f,t.isPrimitive=m,t.isBuffer=e.isBuffer}).call(t,n(5).Buffer)},function(e,t,n){t=e.exports=n(58),t.Stream=t,t.Readable=t,t.Writable=n(37),t.Duplex=n(13),t.Transform=n(59),t.PassThrough=n(84)},function(e,t,n){(function(e,i){function s(e,n){var i={seen:[],stylize:o};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),m(n)?i.showHidden=n:n&&t._extend(i,n),y(i.showHidden)&&(i.showHidden=!1),y(i.depth)&&(i.depth=2),y(i.colors)&&(i.colors=!1),y(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=r),c(i,e,i.depth)}function r(e,t){var n=s.styles[t];return n?"["+s.colors[n][0]+"m"+e+"["+s.colors[n][1]+"m":e}function o(e,t){return e}function a(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function c(e,n,i){if(e.customInspect&&n&&T(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var s=n.inspect(i,e);return b(s)||(s=c(e,s,i)),s}var r=u(e,n);if(r)return r;var o=Object.keys(n),m=a(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(n)),A(n)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(n);if(0===o.length){if(T(n)){var g=n.name?": "+n.name:"";return e.stylize("[Function"+g+"]","special")}if(_(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(R(n))return e.stylize(Date.prototype.toString.call(n),"date");if(A(n))return l(n)}var v="",E=!1,w=["{","}"];if(f(n)&&(E=!0,w=["[","]"]),T(n)){v=" [Function"+(n.name?": "+n.name:"")+"]"}if(_(n)&&(v=" "+RegExp.prototype.toString.call(n)),R(n)&&(v=" "+Date.prototype.toUTCString.call(n)),A(n)&&(v=" "+l(n)),0===o.length&&(!E||0==n.length))return w[0]+v+w[1];if(i<0)return _(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special");e.seen.push(n);var y;return y=E?h(e,n,i,m,o):o.map(function(t){return p(e,n,i,m,t,E)}),e.seen.pop(),d(y,v,w)}function u(e,t){if(y(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return E(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,i,s){for(var r=[],o=0,a=t.length;o-1&&(a=r?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),y(o)){if(r&&s.match(/^\d+$/))return a;o=JSON.stringify(""+s),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+a}function d(e,t,n){var i=0;return e.reduce(function(e,t){return i++,t.indexOf("\n")>=0&&i++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function f(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function g(e){return null===e}function v(e){return null==e}function E(e){return"number"==typeof e}function b(e){return"string"==typeof e}function w(e){return"symbol"==typeof e}function y(e){return void 0===e}function _(e){return x(e)&&"[object RegExp]"===S(e)}function x(e){return"object"==typeof e&&null!==e}function R(e){return x(e)&&"[object Date]"===S(e)}function A(e){return x(e)&&("[object Error]"===S(e)||e instanceof Error)}function T(e){return"function"==typeof e}function k(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function S(e){return Object.prototype.toString.call(e)}function D(e){return e<10?"0"+e.toString(10):e.toString(10)}function M(){var e=new Date,t=[D(e.getHours()),D(e.getMinutes()),D(e.getSeconds())].join(":");return[e.getDate(),U[e.getMonth()],t].join(" ")}function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.format=function(e){if(!b(e)){for(var t=[],n=0;n=r)return e;switch(e){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(e){return"[Circular]"}default:return e}}),a=i[n];nthis.client.resolver.resolveBuffer(e.attachment).then(t=>{e.file=t;return e}))).then(n=>this.client.rest.methods.sendMessage(this,e,t,n))}return this.client.rest.methods.sendMessage(this,e,t)}fetchMessage(e){return this.client.user.bot?this.client.rest.methods.getChannelMessage(this,e).then(e=>{const t=e instanceof s?e:new s(this,e,this.client);this._cacheMessage(t);return t}):this.fetchMessages({limit:1,around:e}).then(t=>{const n=t.get(e);if(!n)throw new Error("Message not found.");return n})}fetchMessages(e={}){return this.client.rest.methods.getChannelMessages(this,e).then(e=>{const t=new o;for(const n of e){const e=new s(this,n,this.client);t.set(n.id,e),this._cacheMessage(e)}return t})}fetchPinnedMessages(){return this.client.rest.methods.getChannelPinnedMessages(this).then(e=>{const t=new o;for(const n of e){const e=new s(this,n,this.client);t.set(n.id,e),this._cacheMessage(e)}return t})}search(e={}){return this.client.rest.methods.search(this,e)}startTyping(e){if(void 0!==e&&e<1)throw new RangeError("Count must be at least 1.");if(this.client.user._typing.has(this.id)){const t=this.client.user._typing.get(this.id);t.count=e||t.count+1}else this.client.user._typing.set(this.id,{count:e||1,interval:this.client.setInterval(()=>{this.client.rest.methods.sendTyping(this.id)},9e3)}),this.client.rest.methods.sendTyping(this.id)}stopTyping(e=!1){if(this.client.user._typing.has(this.id)){const t=this.client.user._typing.get(this.id);t.count--,(t.count<=0||e)&&(this.client.clearInterval(t.interval),this.client.user._typing.delete(this.id))}}get typing(){return this.client.user._typing.has(this.id)}get typingCount(){return this.client.user._typing.has(this.id)?this.client.user._typing.get(this.id).count:0}createCollector(e,t){return this.createMessageCollector(e,t)}createMessageCollector(e,t={}){return new r(this,e,t)}awaitMessages(e,t={}){return new Promise((n,i)=>{const s=this.createCollector(e,t);s.once("end",(e,s)=>{t.errors&&t.errors.includes(s)?i(e):n(e)})})}bulkDelete(e,t=!1){if(!isNaN(e))return this.fetchMessages({limit:e}).then(e=>this.bulkDelete(e,t));if(e instanceof Array||e instanceof o){const n=e instanceof o?e.keyArray():e.map(e=>e.id);return this.client.rest.methods.bulkDeleteMessages(this,n,t)}throw new TypeError("The messages must be an Array, Collection, or number.")}acknowledge(){return this.lastMessageID?this.client.rest.methods.ackTextChannel(this):Promise.resolve(this)}_cacheMessage(e){const t=this.client.options.messageCacheMaxSize;return 0===t?null:(this.messages.size>=t&&t>0&&this.messages.delete(this.messages.firstKey()),this.messages.set(e.id,e),e)}}const u={sendMessage(e,t){return this.send(e,t)},sendEmbed(e,t,n){return n||"object"!=typeof t||t instanceof Array?n||(n={}):(n=t,t=""),this.send(t,Object.assign(n,{embed:e}))},sendFiles(e,t,n={}){return this.send(t,Object.assign(n,{files:e}))},sendFile(e,t,n,i={}){return this.send({files:[{attachment:e,name:t}],content:n,options:i})},sendCode(e,t,n={}){return this.send(t,Object.assign(n,{code:e}))}};for(const e of Object.keys(u))c.prototype[e]=a.deprecate(u[e],`TextChannel#${e}: use TextChannel#send instead`);t.applyToClass=((e,t=!1,n=[])=>{const i=["send","sendMessage","sendEmbed","sendFile","sendFiles","sendCode"];t&&i.push("_cacheMessage","acknowledge","fetchMessages","fetchMessage","search","bulkDelete","startTyping","stopTyping","typing","typingCount","fetchPinnedMessages","createCollector","createMessageCollector","awaitMessages");for(const t of i)n.includes(t)||Object.defineProperty(e.prototype,t,Object.getOwnPropertyDescriptor(c.prototype,t))})},function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!=typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n"},function(e,t,n){const i=n(34),s=n(16),r=n(15),o=n(17),a=n(11).Presence,c=n(18),u=n(0),l=n(3),h=n(4),p=n(7);class d{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.members=new l,this.channels=new l,this.roles=new l,this.presences=new l,t&&(t.unavailable?(this.available=!1,this.id=t.id):(this.available=!0,this.setup(t)))}setup(e){if(this.name=e.name,this.icon=e.icon,this.splash=e.splash,this.region=e.region,this.memberCount=e.member_count||this.memberCount,this.large=Boolean("large"in e?e.large:this.large),this.features=e.features,this.applicationID=e.application_id,this.afkTimeout=e.afk_timeout,this.afkChannelID=e.afk_channel_id,this.embedEnabled=e.embed_enabled,this.verificationLevel=e.verification_level,this.explicitContentFilter=e.explicit_content_filter,this.joinedTimestamp=e.joined_at?new Date(e.joined_at).getTime():this.joinedTimestamp,this.id=e.id,this.available=!e.unavailable,this.features=e.features||this.features||[],e.members){this.members.clear();for(const t of e.members)this._addMember(t,!1)}if(e.owner_id&&(this.ownerID=e.owner_id),e.channels){this.channels.clear();for(const t of e.channels)this.client.dataManager.newChannel(t,this)}if(e.roles){this.roles.clear();for(const t of e.roles){const e=new r(this,t);this.roles.set(e.id,e)}}if(e.presences)for(const t of e.presences)this._setPresence(t.user.id,t);if(this._rawVoiceStates=new l,e.voice_states)for(const t of e.voice_states){this._rawVoiceStates.set(t.user_id,t);const e=this.members.get(t.user_id);e&&(e.serverMute=t.mute,e.serverDeaf=t.deaf,e.selfMute=t.self_mute,e.selfDeaf=t.self_deaf,e.voiceSessionID=t.session_id,e.voiceChannelID=t.channel_id,this.channels.get(t.channel_id).members.set(e.user.id,e))}if(this.emojis)this.client.actions.GuildEmojisUpdate.handle({guild_id:this.id,emojis:e.emojis});else{this.emojis=new l;for(const t of e.emojis)this.emojis.set(t.id,new o(this,t))}}get createdTimestamp(){return p.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get joinedAt(){return new Date(this.joinedTimestamp)}get iconURL(){return this.icon?u.Endpoints.Guild(this).Icon(this.client.options.http.cdn,this.icon):null}get splashURL(){return this.splash?u.Endpoints.Guild(this).Splash(this.client.options.http.cdn,this.splash):null}get owner(){return this.members.get(this.ownerID)}get voiceConnection(){return this.client.browser?null:this.client.voice.connections.get(this.id)||null}get defaultChannel(){return this.channels.get(this.id)}get position(){return this.client.user.bot?null:this.client.user.settings.guildPositions?this.client.user.settings.guildPositions.indexOf(this.id):null}get defaultRole(){return this.roles.get(this.id)}get me(){return this.members.get(this.client.user.id)}get _sortedRoles(){return this._sortPositionWithID(this.roles)}member(e){return this.client.resolver.resolveGuildMember(this,e)}fetchBans(){return this.client.rest.methods.getGuildBans(this).then(e=>{const t=new l;for(const n of e.values())t.set(n.user.id,n.user);return t})}fetchInvites(){return this.client.rest.methods.getGuildInvites(this)}fetchWebhooks(){return this.client.rest.methods.getGuildWebhooks(this)}fetchVoiceRegions(){return this.client.rest.methods.fetchVoiceRegions(this.id)}fetchAuditLogs(e){return this.client.rest.methods.getGuildAuditLogs(this,e)}addMember(e,t){return this.members.has(e.id)?Promise.resolve(this.members.get(e.id)):this.client.rest.methods.putGuildMember(this,e,t)}fetchMember(e,t=!0){return e=this.client.resolver.resolveUser(e),e?this.members.has(e.id)?Promise.resolve(this.members.get(e.id)):this.client.rest.methods.getGuildMember(this,e,t):Promise.reject(new Error("User is not cached. Use Client.fetchUser first."))}fetchMembers(e="",t=0){return new Promise((n,i)=>{if(this.memberCount===this.members.size)return void n(this);this.client.ws.send({op:u.OPCodes.REQUEST_GUILD_MEMBERS,d:{guild_id:this.id,query:e,limit:t}});const s=(e,t)=>{if(t.id!==this.id)return;(this.memberCount===this.members.size||e.length<1e3)&&(this.client.removeListener(u.Events.GUILD_MEMBERS_CHUNK,s),n(this))};this.client.on(u.Events.GUILD_MEMBERS_CHUNK,s);this.client.setTimeout(()=>i(new Error("Members didn't arrive in time.")),12e4)})}search(e={}){return this.client.rest.methods.search(this,e)}edit(e){return this.client.rest.methods.updateGuild(this,e)}setName(e){return this.edit({name:e})}setRegion(e){return this.edit({region:e})}setVerificationLevel(e){return this.edit({verificationLevel:e})}setAFKChannel(e){return this.edit({afkChannel:e})}setAFKTimeout(e){return this.edit({afkTimeout:e})}setIcon(e){return this.edit({icon:e})}setOwner(e){return this.edit({owner:e})}setSplash(e){return this.edit({splash:e})}setPosition(e,t){return this.client.user.bot?Promise.reject(new Error("Setting guild position is only available for user accounts")):this.client.user.settings.setGuildPosition(this,e,t)}acknowledge(){return this.client.rest.methods.ackGuild(this)}allowDMs(e){const t=this.client.user.settings;return e?t.removeRestrictedGuild(this):t.addRestrictedGuild(this)}ban(e,t={}){return"number"==typeof t?t={reason:null,"delete-message-days":t}:"string"==typeof t&&(t={reason:t,"delete-message-days":0}),this.client.rest.methods.banGuildMember(this,e,t)}unban(e){return this.client.rest.methods.unbanGuildMember(this,e)}pruneMembers(e,t=!1){if("number"!=typeof e)throw new TypeError("Days must be a number.");return this.client.rest.methods.pruneGuildMembers(this,e,t)}sync(){this.client.user.bot||this.client.syncGuilds([this])}createChannel(e,t,n){return this.client.rest.methods.createChannel(this,e,t,n)}setChannelPositions(e){return this.client.rest.methods.updateChannelPositions(this.id,e)}createRole(e={}){return this.client.rest.methods.createGuildRole(this,e)}createEmoji(e,t,n){return new Promise(i=>{"string"==typeof e&&e.startsWith("data:")?i(this.client.rest.methods.createEmoji(this,e,t,n)):this.client.resolver.resolveBuffer(e).then(e=>{const s=this.client.resolver.resolveBase64(e);i(this.client.rest.methods.createEmoji(this,s,t,n))})})}deleteEmoji(e){return e instanceof o||(e=this.emojis.get(e)),this.client.rest.methods.deleteEmoji(e)}leave(){return this.client.rest.methods.leaveGuild(this)}delete(){return this.client.rest.methods.deleteGuild(this)}equals(e){let t=e&&this.id===e.id&&this.available===!e.unavailable&&this.splash===e.splash&&this.region===e.region&&this.name===e.name&&this.memberCount===e.member_count&&this.large===e.large&&this.icon===e.icon&&h.arraysEqual(this.features,e.features)&&this.ownerID===e.owner_id&&this.verificationLevel===e.verification_level&&this.embedEnabled===e.embed_enabled;return t&&(this.embedChannel?this.embedChannel.id!==e.embed_channel_id&&(t=!1):e.embed_channel_id&&(t=!1)),t}toString(){return this.name}_addMember(e,t=!0){const n=this.members.has(e.user.id);e.user instanceof s||(e.user=this.client.dataManager.newUser(e.user)),e.joined_at=e.joined_at||0;const i=new c(this,e);if(this.members.set(i.id,i),this._rawVoiceStates&&this._rawVoiceStates.has(i.user.id)){const e=this._rawVoiceStates.get(i.user.id);i.serverMute=e.mute,i.serverDeaf=e.deaf,i.selfMute=e.self_mute,i.selfDeaf=e.self_deaf,i.voiceSessionID=e.session_id,i.voiceChannelID=e.channel_id,this.client.channels.has(e.channel_id)?this.client.channels.get(e.channel_id).members.set(i.user.id,i):this.client.emit("warn",`Member ${i.id} added in guild ${this.id} with an uncached voice channel`)}return this.client.ws.connection.status===u.Status.READY&&t&&!n&&this.client.emit(u.Events.GUILD_MEMBER_ADD,i),i}_updateMember(e,t){const n=h.cloneObject(e);t.roles&&(e._roles=t.roles),void 0!==t.nick&&(e.nickname=t.nick);const i=e.nickname!==n.nickname||!h.arraysEqual(e._roles,n._roles);return this.client.ws.connection.status===u.Status.READY&&i&&this.client.emit(u.Events.GUILD_MEMBER_UPDATE,n,e),{old:n,mem:e}}_removeMember(e){this.members.delete(e.id)}_memberSpeakUpdate(e,t){const n=this.members.get(e);n&&n.speaking!==t&&(n.speaking=t,this.client.emit(u.Events.GUILD_MEMBER_SPEAKING,n,t))}_setPresence(e,t){if(this.presences.get(e))return void this.presences.get(e).update(t);this.presences.set(e,new a(t))}setRolePosition(e,t,n=!1){if("string"==typeof e&&!(e=this.roles.get(e)))return Promise.reject(new Error("Supplied role is not a role or snowflake."));if(t=Number(t),isNaN(t))return Promise.reject(new Error("Supplied position is not a number."));let i=this._sortedRoles.array();return h.moveElementInArray(i,e,t,n),i=i.map((e,t)=>({id:e.id,position:t})),this.client.rest.methods.setRolePositions(this.id,i)}setChannelPosition(e,t,n=!1){if("string"==typeof e&&!(e=this.channels.get(e)))return Promise.reject(new Error("Supplied channel is not a channel or snowflake."));if(t=Number(t),isNaN(t))return Promise.reject(new Error("Supplied position is not a number."));let i=this._sortedChannels(e.type).array();return h.moveElementInArray(i,e,t,n),i=i.map((e,t)=>({id:e.id,position:t})),this.client.rest.methods.setChannelPositions(this.id,i)}_sortedChannels(e){return this._sortPositionWithID(this.channels.filter(t=>"voice"===e&&"voice"===t.type||("voice"!==e&&"voice"!==t.type||e===t.type)))}_sortPositionWithID(e){return e.sort((e,t)=>e.position!==t.position?e.position-t.position:i.fromString(e.id).sub(i.fromString(t.id)).toNumber())}}e.exports=d},function(e,t,n){const i=n(14),s=n(15),r=n(53),o=n(9),a=n(3);class c extends i{constructor(e,t){super(e.client,t),this.guild=e}setup(e){if(super.setup(e),this.name=e.name,this.position=e.position,this.permissionOverwrites=new a,e.permission_overwrites)for(const t of e.permission_overwrites)this.permissionOverwrites.set(t.id,new r(this,t))}get calculatedPosition(){const e=this.guild._sortedChannels(this.type);return e.array().indexOf(e.get(this.id))}permissionsFor(e){if(!(e=this.client.resolver.resolveGuildMember(this.guild,e)))return null;if(e.id===this.guild.ownerID)return new o(e,o.ALL);let t=0;const n=e.roles;for(const e of n.values())t|=e.permissions;const i=this.overwritesFor(e,!0,n);i.everyone&&(t&=~i.everyone.deny,t|=i.everyone.allow);let s=0;for(const e of i.roles)t&=~e.deny,s|=e.allow;return t|=s,i.member&&(t&=~i.member.deny,t|=i.member.allow),Boolean(t&o.FLAGS.ADMINISTRATOR)&&(t=o.ALL),new o(e,t)}overwritesFor(e,t=!1,n=null){if(t||(e=this.client.resolver.resolveGuildMember(this.guild,e)),!e)return[];n=n||e.roles;const i=[];let s,r;for(const t of this.permissionOverwrites.values())t.id===this.guild.id?r=t:n.has(t.id)?i.push(t):t.id===e.id&&(s=t);return{everyone:r,roles:i,member:s}}overwritePermissions(e,t){const n={allow:0,deny:0};if(e instanceof s)n.type="role";else if(this.guild.roles.has(e))e=this.guild.roles.get(e),n.type="role";else if(e=this.client.resolver.resolveUser(e),n.type="member",!e)return Promise.reject(new TypeError("Supplied parameter was neither a User nor a Role."));n.id=e.id;const i=this.permissionOverwrites.get(e.id);i&&(n.allow=i.allow,n.deny=i.deny);for(const e in t)!0===t[e]?(n.allow|=o.FLAGS[e]||0,n.deny&=~(o.FLAGS[e]||0)):!1===t[e]?(n.allow&=~(o.FLAGS[e]||0),n.deny|=o.FLAGS[e]||0):null===t[e]&&(n.allow&=~(o.FLAGS[e]||0),n.deny&=~(o.FLAGS[e]||0));return this.client.rest.methods.setChannelOverwrite(this,n)}edit(e){return this.client.rest.methods.updateChannel(this,e)}setName(e){return this.edit({name:e})}setPosition(e,t){return this.guild.setChannelPosition(this,e,t).then(()=>this)}setTopic(e){return this.client.rest.methods.updateChannel(this,{topic:e})}createInvite(e={}){return this.client.rest.methods.createChannelInvite(this,e)}clone(e=this.name,t=!0,n=!0){return this.guild.createChannel(e,this.type,t?this.permissionOverwrites:[]).then(e=>n?e.setTopic(this.topic):e)}equals(e){let t=e&&this.id===e.id&&this.type===e.type&&this.topic===e.topic&&this.position===e.position&&this.name===e.name;return t&&(t=this.permissionOverwrites&&e.permissionOverwrites?this.permissionOverwrites.equals(e.permissionOverwrites):!this.permissionOverwrites&&!e.permissionOverwrites),t}get deletable(){return this.id!==this.guild.id&&this.permissionsFor(this.client.user).has(o.FLAGS.MANAGE_CHANNELS)}toString(){return`<#${this.id}>`}}e.exports=c},function(e,t,n){(function(e){function n(e,t){for(var n=0,i=e.length-1;i>=0;i--){var s=e[i];"."===s?e.splice(i,1):".."===s?(e.splice(i,1),n++):n&&(e.splice(i,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function i(e,t){if(e.filter)return e.filter(t);for(var n=[],i=0;i=-1&&!s;r--){var o=r>=0?arguments[r]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(t=o+"/"+t,s="/"===o.charAt(0))}return t=n(i(t.split("/"),function(e){return!!e}),!s).join("/"),(s?"/":"")+t||"."},t.normalize=function(e){var s=t.isAbsolute(e),r="/"===o(e,-1);return e=n(i(e.split("/"),function(e){return!!e}),!s).join("/"),e||s||(e="."),e&&r&&(e+="/"),(s?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(i(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function i(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var s=i(e.split("/")),r=i(n.split("/")),o=Math.min(s.length,r.length),a=o,c=0;c[e.id,e.nick]))),this.recipients||(this.recipients=new r),e.recipients)for(const t of e.recipients){const e=this.client.dataManager.newUser(t);this.recipients.set(e.id,e)}this.lastMessageID=e.last_message_id}get owner(){return this.client.users.get(this.ownerID)}equals(e){const t=e&&this.id===e.id&&this.name===e.name&&this.icon===e.icon&&this.ownerID===e.ownerID;return t?this.recipients.equals(e.recipients):t}addUser(e,t){return this.client.rest.methods.addUserToGroupDM(this,{nick:t,id:this.client.resolver.resolveUserID(e),accessToken:e})}toString(){return this.name}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendFiles(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}acknowledge(){}_cacheMessage(){}}s.applyToClass(o,!0,["bulkDelete"]),e.exports=o},function(e,t){class n{constructor(e,t,n){this.reaction=e,this.name=t,this.id=n}get identifier(){return this.id?`${this.name}:${this.id}`:encodeURIComponent(this.name)}toString(){return this.id?`<:${this.name}:${this.id}>`:this.name}}e.exports=n},function(e,t,n){const i=n(27);class s{constructor(e,t,n){e?(Object.defineProperty(this,"client",{value:e}),t&&this.setup(t)):(this.id=t,this.token=n,Object.defineProperty(this,"client",{value:this}))}setup(e){this.name=e.name,this.token=e.token,this.avatar=e.avatar,this.id=e.id,this.guildID=e.guild_id,this.channelID=e.channel_id,e.user?this.owner=this.client.users?this.client.users.get(e.user.id):e.user:this.owner=null}send(e,t){return t||"object"!=typeof e||e instanceof Array?t||(t={}):(t=e,e=""),t.file?("string"==typeof t.file&&(t.file={attachment:t.file}),t.file.name||("string"==typeof t.file.attachment?t.file.name=i.basename(t.file.attachment):t.file.attachment&&t.file.attachment.path?t.file.name=i.basename(t.file.attachment.path):t.file.name="file.jpg"),this.client.resolver.resolveBuffer(t.file.attachment).then(n=>this.client.rest.methods.sendWebhookMessage(this,e,t,{file:n,name:t.file.name}))):this.client.rest.methods.sendWebhookMessage(this,e,t)}sendMessage(e,t={}){return this.send(e,t)}sendFile(e,t,n,i={}){return this.send(n,Object.assign(i,{file:{attachment:e,name:t}}))}sendCode(e,t,n={}){return this.send(t,Object.assign(n,{code:e}))}sendSlackMessage(e){return this.client.rest.methods.sendSlackWebhookMessage(this,e)}edit(e=this.name,t){return t?this.client.resolver.resolveBuffer(t).then(t=>{const n=this.client.resolver.resolveBase64(t);return this.client.rest.methods.editWebhook(this,e,n)}):this.client.rest.methods.editWebhook(this,e).then(e=>{this.setup(e);return this})}delete(){return this.client.rest.methods.deleteWebhook(this)}}e.exports=s},function(e,t,n){const i=n(3),s=n(12).EventEmitter;class r extends s{constructor(e,t,n={}){super(),Object.defineProperty(this,"client",{value: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(e,t,n){"use strict";(function(e){var i=n(5),s=i.Buffer,r=i.SlowBuffer,o=i.kMaxLength||2147483647;t.alloc=function(e,t,n){if("function"==typeof s.alloc)return s.alloc(e,t,n);if("number"==typeof n)throw new TypeError("encoding must not be number");if("number"!=typeof e)throw new TypeError("size must be a number");if(e>o)throw new RangeError("size is too large");var i=n,r=t;void 0===r&&(i=void 0,r=0);var a=new s(e);if("string"==typeof r)for(var c=new s(r,i),u=c.length,l=-1;++lo)throw new RangeError("size is too large");return new s(e)},t.from=function(t,n,i){if("function"==typeof s.from&&(!e.Uint8Array||Uint8Array.from!==s.from))return s.from(t,n,i);if("number"==typeof t)throw new TypeError('"value" argument must not be a number');if("string"==typeof t)return new s(t,n);if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer){var r=n;if(1===arguments.length)return new s(t);void 0===r&&(r=0);var o=i;if(void 0===o&&(o=t.byteLength-r),r>=t.byteLength)throw new RangeError("'offset' is out of bounds");if(o>t.byteLength-r)throw new RangeError("'length' is out of bounds");return new s(t.slice(r,r+o))}if(s.isBuffer(t)){var a=new s(t.length);return t.copy(a,0,0,t.length),a}if(t){if(Array.isArray(t)||"undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return new s(t);if("Buffer"===t.type&&Array.isArray(t.data))return new s(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},t.allocUnsafeSlow=function(e){if("function"==typeof s.allocUnsafeSlow)return s.allocUnsafeSlow(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>=o)throw new RangeError("size is too large");return new r(e)}}).call(t,n(8))},function(e,t,n){var i,s,r;/** * @license long.js (c) 2013 Daniel Wirtz * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/long.js for details