New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

discord-moosik

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-moosik - npm Package Compare versions

Comparing version 0.5.5 to 0.5.6

128

lib/bot.js

@@ -18,130 +18,2 @@ 'use babel';

Function.prototype.$asyncbind = function anonymous(self, catcher) {
var resolver = this;
if (catcher === true) {
if (!Function.prototype.$asyncbind.EagerThenable) Function.prototype.$asyncbind.EagerThenable = function factory(tick) {
var _tasks = [];
if (!tick) {
try {
tick = process.nextTick;
} catch (ex) {
tick = function tick(p) {
setTimeout(p, 0);
};
}
}
function _untask() {
for (var i = 0; i < _tasks.length; i += 2) {
var t = _tasks[i + 1],
r = _tasks[i];
for (var j = 0; j < t.length; j++) t[j].call(null, r);
}
_tasks = [];
}
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === 'function';
}
function EagerThenable(resolver) {
function done(inline) {
var w;
if (_sync || phase < 0 || (w = _thens[phase]).length === 0) return;
_tasks.push(result, w);
_thens = [[], []];
if (_tasks.length === 2) inline ? _untask() : tick(_untask);
}
function resolveThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 0;
result = x;
done(true);
}
function rejectThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 1;
result = x;
done(true);
}
function settler(resolver, rejecter) {
_thens[0].push(resolver);
_thens[1].push(rejecter);
done();
}
function toString() {
return 'EagerThenable{' + {
'-1': 'pending',
0: 'resolved',
1: 'rejected'
}[phase] + '}=' + result.toString();
}
function guard() {
try {
resolver.call(null, resolveThen, rejectThen);
} catch (ex) {
rejectThen(ex);
}
}
this.then = settler;
this.toString = toString;
var _thens = [[], []],
_sync = true,
phase = -1,
result;
guard();
_sync = false;
done();
}
EagerThenable.resolve = function (v) {
return isThenable(v) ? v : {
then: function then(resolve, reject) {
return resolve(v);
}
};
};
return EagerThenable;
}();
return new Function.prototype.$asyncbind.EagerThenable(boundThen);
}
if (catcher) {
if (Function.prototype.$asyncbind.wrapAsyncStack) catcher = Function.prototype.$asyncbind.wrapAsyncStack(catcher);
return then;
}
function then(result, error) {
try {
return result && result instanceof Object && typeof result.then === 'function' ? result.then(then, catcher) : resolver.call(self, result, error || catcher);
} catch (ex) {
return (error || catcher)(ex);
}
}
function boundThen(result, error) {
return resolver.call(self, result, error);
}
boundThen.then = boundThen;
return boundThen;
};
exports.default = new _discordGraf.Bot({

@@ -148,0 +20,0 @@ name: 'Moosik',

330

lib/commands/music/default-volume.js

@@ -18,128 +18,284 @@ 'use babel';

Function.prototype.$asyncbind = function anonymous(self, catcher) {
var resolver = this;
Function.prototype.$asyncbind = function $asyncbind(self, catcher) {
"use strict";
if (catcher === true) {
if (!Function.prototype.$asyncbind.EagerThenable) Function.prototype.$asyncbind.EagerThenable = function factory(tick) {
var _tasks = [];
if (!Function.prototype.$asyncbind) {
Object.defineProperty(Function.prototype, "$asyncbind", {
value: $asyncbind,
enumerable: false,
configurable: true,
writable: true
});
}
if (!tick) {
if (!$asyncbind.trampoline) {
$asyncbind.trampoline = function trampoline(t, x, s, e, u) {
return function b(q) {
while (q) {
if (q.then) {
q = q.then(b, e);
return u ? undefined : q;
}
try {
if (q.pop) {
if (q.length) return q.pop() ? x.call(t) : q;
q = s;
} else q = q.call(t);
} catch (r) {
return e(r);
}
}
};
};
}
if (!$asyncbind.LazyThenable) {
$asyncbind.LazyThenable = function () {
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === "function";
}
function resolution(p, r, how) {
try {
tick = process.nextTick;
var x = how ? how(r) : r;
if (p === x) return p.reject(new TypeError("Promise resolution loop"));
if (isThenable(x)) {
x.then(function (y) {
resolution(p, y);
}, function (e) {
p.reject(e);
});
} else {
p.resolve(x);
}
} catch (ex) {
tick = function tick(p) {
setTimeout(p, 0);
};
p.reject(ex);
}
}
function _untask() {
for (var i = 0; i < _tasks.length; i += 2) {
var t = _tasks[i + 1],
r = _tasks[i];
function Chained() {}
for (var j = 0; j < t.length; j++) t[j].call(null, r);
;
Chained.prototype = {
resolve: _unchained,
reject: _unchained,
then: thenChain
};
function _unchained(v) {}
function thenChain(res, rej) {
this.resolve = res;
this.reject = rej;
}
function then(res, rej) {
var chain = new Chained();
try {
this._resolver(function (value) {
return isThenable(value) ? value.then(res, rej) : resolution(chain, value, res);
}, function (ex) {
resolution(chain, ex, rej);
});
} catch (ex) {
resolution(chain, ex, rej);
}
_tasks = [];
return chain;
}
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === 'function';
function Thenable(resolver) {
this._resolver = resolver;
this.then = then;
}
function EagerThenable(resolver) {
function done(inline) {
var w;
if (_sync || phase < 0 || (w = _thens[phase]).length === 0) return;
;
_tasks.push(result, w);
Thenable.resolve = function (v) {
return Thenable.isThenable(v) ? v : {
then: function then(resolve) {
return resolve(v);
}
};
};
_thens = [[], []];
if (_tasks.length === 2) inline ? _untask() : tick(_untask);
}
Thenable.isThenable = isThenable;
return Thenable;
}();
function resolveThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 0;
result = x;
done(true);
$asyncbind.EagerThenable = $asyncbind.Thenable = ($asyncbind.EagerThenableFactory = function (tick) {
tick = tick || typeof process === "object" && process.nextTick || typeof setImmediate === "function" && setImmediate || function (f) {
setTimeout(f, 0);
};
var soon = function () {
var fq = [],
fqStart = 0,
bufferSize = 1024;
function callQueue() {
while (fq.length - fqStart) {
fq[fqStart]();
fq[fqStart++] = undefined;
if (fqStart === bufferSize) {
fq.splice(0, bufferSize);
fqStart = 0;
}
}
}
function rejectThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 1;
result = x;
done(true);
return function (fn) {
fq.push(fn);
if (fq.length - fqStart === 1) tick(callQueue);
};
}();
function Zousan(func) {
if (func) {
var me = this;
func(function (arg) {
me.resolve(arg);
}, function (arg) {
me.reject(arg);
});
}
}
function settler(resolver, rejecter) {
_thens[0].push(resolver);
Zousan.prototype = {
resolve: function resolve(value) {
if (this.state !== undefined) return;
if (value === this) return this.reject(new TypeError("Attempt to resolve promise with self"));
var me = this;
_thens[1].push(rejecter);
if (value && (typeof value === "function" || typeof value === "object")) {
try {
var first = 0;
var then = value.then;
done();
}
if (typeof then === "function") {
then.call(value, function (ra) {
if (!first++) {
me.resolve(ra);
}
}, function (rr) {
if (!first++) {
me.reject(rr);
}
});
return;
}
} catch (e) {
if (!first) this.reject(e);
return;
}
}
function toString() {
return 'EagerThenable{' + {
'-1': 'pending',
0: 'resolved',
1: 'rejected'
}[phase] + '}=' + result.toString();
this.state = STATE_FULFILLED;
this.v = value;
if (me.c) soon(function () {
for (var n = 0, l = me.c.length; n < l; n++) STATE_FULFILLED(me.c[n], value);
});
},
reject: function reject(reason) {
if (this.state !== undefined) return;
this.state = STATE_REJECTED;
this.v = reason;
var clients = this.c;
if (clients) soon(function () {
for (var n = 0, l = clients.length; n < l; n++) STATE_REJECTED(clients[n], reason);
});
},
then: function then(onF, onR) {
var p = new Zousan();
var client = {
y: onF,
n: onR,
p: p
};
if (this.state === undefined) {
if (this.c) this.c.push(client);else this.c = [client];
} else {
var s = this.state,
a = this.v;
soon(function () {
s(client, a);
});
}
return p;
}
};
function guard() {
function STATE_FULFILLED(c, arg) {
if (typeof c.y === "function") {
try {
resolver.call(null, resolveThen, rejectThen);
} catch (ex) {
rejectThen(ex);
var yret = c.y.call(undefined, arg);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
}
} else c.p.resolve(arg);
}
this.then = settler;
this.toString = toString;
var _thens = [[], []],
_sync = true,
phase = -1,
result;
guard();
_sync = false;
done();
function STATE_REJECTED(c, reason) {
if (typeof c.n === "function") {
try {
var yret = c.n.call(undefined, reason);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
} else c.p.reject(reason);
}
EagerThenable.resolve = function (v) {
return isThenable(v) ? v : {
then: function then(resolve, reject) {
return resolve(v);
}
};
Zousan.resolve = function (val) {
if (val && val instanceof Zousan) return val;
var z = new Zousan();
z.resolve(val);
return z;
};
return EagerThenable;
}();
return new Function.prototype.$asyncbind.EagerThenable(boundThen);
}
Zousan.reject = function (err) {
if (err && err instanceof Zousan) return err;
var z = new Zousan();
z.reject(err);
return z;
};
if (catcher) {
if (Function.prototype.$asyncbind.wrapAsyncStack) catcher = Function.prototype.$asyncbind.wrapAsyncStack(catcher);
return then;
Zousan.version = "2.3.2-nodent";
return Zousan;
})();
}
function then(result, error) {
try {
return result && result instanceof Object && typeof result.then === 'function' ? result.then(then, catcher) : resolver.call(self, result, error || catcher);
} catch (ex) {
return (error || catcher)(ex);
}
var resolver = this;
switch (catcher) {
case true:
return new $asyncbind.Thenable(boundThen);
case 0:
return new $asyncbind.LazyThenable(boundThen);
case undefined:
boundThen.then = boundThen;
return boundThen;
default:
return function () {
try {
return resolver.apply(self, arguments);
} catch (ex) {
return catcher(ex);
}
};
}
function boundThen(result, error) {
return resolver.call(self, result, error);
function boundThen() {
return resolver.apply(self, arguments);
}
boundThen.then = boundThen;
return boundThen;
};

@@ -146,0 +302,0 @@

@@ -18,128 +18,284 @@ 'use babel';

Function.prototype.$asyncbind = function anonymous(self, catcher) {
var resolver = this;
Function.prototype.$asyncbind = function $asyncbind(self, catcher) {
"use strict";
if (catcher === true) {
if (!Function.prototype.$asyncbind.EagerThenable) Function.prototype.$asyncbind.EagerThenable = function factory(tick) {
var _tasks = [];
if (!Function.prototype.$asyncbind) {
Object.defineProperty(Function.prototype, "$asyncbind", {
value: $asyncbind,
enumerable: false,
configurable: true,
writable: true
});
}
if (!tick) {
if (!$asyncbind.trampoline) {
$asyncbind.trampoline = function trampoline(t, x, s, e, u) {
return function b(q) {
while (q) {
if (q.then) {
q = q.then(b, e);
return u ? undefined : q;
}
try {
if (q.pop) {
if (q.length) return q.pop() ? x.call(t) : q;
q = s;
} else q = q.call(t);
} catch (r) {
return e(r);
}
}
};
};
}
if (!$asyncbind.LazyThenable) {
$asyncbind.LazyThenable = function () {
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === "function";
}
function resolution(p, r, how) {
try {
tick = process.nextTick;
var x = how ? how(r) : r;
if (p === x) return p.reject(new TypeError("Promise resolution loop"));
if (isThenable(x)) {
x.then(function (y) {
resolution(p, y);
}, function (e) {
p.reject(e);
});
} else {
p.resolve(x);
}
} catch (ex) {
tick = function tick(p) {
setTimeout(p, 0);
};
p.reject(ex);
}
}
function _untask() {
for (var i = 0; i < _tasks.length; i += 2) {
var t = _tasks[i + 1],
r = _tasks[i];
function Chained() {}
for (var j = 0; j < t.length; j++) t[j].call(null, r);
;
Chained.prototype = {
resolve: _unchained,
reject: _unchained,
then: thenChain
};
function _unchained(v) {}
function thenChain(res, rej) {
this.resolve = res;
this.reject = rej;
}
function then(res, rej) {
var chain = new Chained();
try {
this._resolver(function (value) {
return isThenable(value) ? value.then(res, rej) : resolution(chain, value, res);
}, function (ex) {
resolution(chain, ex, rej);
});
} catch (ex) {
resolution(chain, ex, rej);
}
_tasks = [];
return chain;
}
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === 'function';
function Thenable(resolver) {
this._resolver = resolver;
this.then = then;
}
function EagerThenable(resolver) {
function done(inline) {
var w;
if (_sync || phase < 0 || (w = _thens[phase]).length === 0) return;
;
_tasks.push(result, w);
Thenable.resolve = function (v) {
return Thenable.isThenable(v) ? v : {
then: function then(resolve) {
return resolve(v);
}
};
};
_thens = [[], []];
if (_tasks.length === 2) inline ? _untask() : tick(_untask);
}
Thenable.isThenable = isThenable;
return Thenable;
}();
function resolveThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 0;
result = x;
done(true);
$asyncbind.EagerThenable = $asyncbind.Thenable = ($asyncbind.EagerThenableFactory = function (tick) {
tick = tick || typeof process === "object" && process.nextTick || typeof setImmediate === "function" && setImmediate || function (f) {
setTimeout(f, 0);
};
var soon = function () {
var fq = [],
fqStart = 0,
bufferSize = 1024;
function callQueue() {
while (fq.length - fqStart) {
fq[fqStart]();
fq[fqStart++] = undefined;
if (fqStart === bufferSize) {
fq.splice(0, bufferSize);
fqStart = 0;
}
}
}
function rejectThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 1;
result = x;
done(true);
return function (fn) {
fq.push(fn);
if (fq.length - fqStart === 1) tick(callQueue);
};
}();
function Zousan(func) {
if (func) {
var me = this;
func(function (arg) {
me.resolve(arg);
}, function (arg) {
me.reject(arg);
});
}
}
function settler(resolver, rejecter) {
_thens[0].push(resolver);
Zousan.prototype = {
resolve: function resolve(value) {
if (this.state !== undefined) return;
if (value === this) return this.reject(new TypeError("Attempt to resolve promise with self"));
var me = this;
_thens[1].push(rejecter);
if (value && (typeof value === "function" || typeof value === "object")) {
try {
var first = 0;
var then = value.then;
done();
}
if (typeof then === "function") {
then.call(value, function (ra) {
if (!first++) {
me.resolve(ra);
}
}, function (rr) {
if (!first++) {
me.reject(rr);
}
});
return;
}
} catch (e) {
if (!first) this.reject(e);
return;
}
}
function toString() {
return 'EagerThenable{' + {
'-1': 'pending',
0: 'resolved',
1: 'rejected'
}[phase] + '}=' + result.toString();
this.state = STATE_FULFILLED;
this.v = value;
if (me.c) soon(function () {
for (var n = 0, l = me.c.length; n < l; n++) STATE_FULFILLED(me.c[n], value);
});
},
reject: function reject(reason) {
if (this.state !== undefined) return;
this.state = STATE_REJECTED;
this.v = reason;
var clients = this.c;
if (clients) soon(function () {
for (var n = 0, l = clients.length; n < l; n++) STATE_REJECTED(clients[n], reason);
});
},
then: function then(onF, onR) {
var p = new Zousan();
var client = {
y: onF,
n: onR,
p: p
};
if (this.state === undefined) {
if (this.c) this.c.push(client);else this.c = [client];
} else {
var s = this.state,
a = this.v;
soon(function () {
s(client, a);
});
}
return p;
}
};
function guard() {
function STATE_FULFILLED(c, arg) {
if (typeof c.y === "function") {
try {
resolver.call(null, resolveThen, rejectThen);
} catch (ex) {
rejectThen(ex);
var yret = c.y.call(undefined, arg);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
}
} else c.p.resolve(arg);
}
this.then = settler;
this.toString = toString;
var _thens = [[], []],
_sync = true,
phase = -1,
result;
guard();
_sync = false;
done();
function STATE_REJECTED(c, reason) {
if (typeof c.n === "function") {
try {
var yret = c.n.call(undefined, reason);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
} else c.p.reject(reason);
}
EagerThenable.resolve = function (v) {
return isThenable(v) ? v : {
then: function then(resolve, reject) {
return resolve(v);
}
};
Zousan.resolve = function (val) {
if (val && val instanceof Zousan) return val;
var z = new Zousan();
z.resolve(val);
return z;
};
return EagerThenable;
}();
return new Function.prototype.$asyncbind.EagerThenable(boundThen);
}
Zousan.reject = function (err) {
if (err && err instanceof Zousan) return err;
var z = new Zousan();
z.reject(err);
return z;
};
if (catcher) {
if (Function.prototype.$asyncbind.wrapAsyncStack) catcher = Function.prototype.$asyncbind.wrapAsyncStack(catcher);
return then;
Zousan.version = "2.3.2-nodent";
return Zousan;
})();
}
function then(result, error) {
try {
return result && result instanceof Object && typeof result.then === 'function' ? result.then(then, catcher) : resolver.call(self, result, error || catcher);
} catch (ex) {
return (error || catcher)(ex);
}
var resolver = this;
switch (catcher) {
case true:
return new $asyncbind.Thenable(boundThen);
case 0:
return new $asyncbind.LazyThenable(boundThen);
case undefined:
boundThen.then = boundThen;
return boundThen;
default:
return function () {
try {
return resolver.apply(self, arguments);
} catch (ex) {
return catcher(ex);
}
};
}
function boundThen(result, error) {
return resolver.call(self, result, error);
function boundThen() {
return resolver.apply(self, arguments);
}
boundThen.then = boundThen;
return boundThen;
};

@@ -146,0 +302,0 @@

@@ -18,128 +18,284 @@ 'use babel';

Function.prototype.$asyncbind = function anonymous(self, catcher) {
var resolver = this;
Function.prototype.$asyncbind = function $asyncbind(self, catcher) {
"use strict";
if (catcher === true) {
if (!Function.prototype.$asyncbind.EagerThenable) Function.prototype.$asyncbind.EagerThenable = function factory(tick) {
var _tasks = [];
if (!Function.prototype.$asyncbind) {
Object.defineProperty(Function.prototype, "$asyncbind", {
value: $asyncbind,
enumerable: false,
configurable: true,
writable: true
});
}
if (!tick) {
if (!$asyncbind.trampoline) {
$asyncbind.trampoline = function trampoline(t, x, s, e, u) {
return function b(q) {
while (q) {
if (q.then) {
q = q.then(b, e);
return u ? undefined : q;
}
try {
if (q.pop) {
if (q.length) return q.pop() ? x.call(t) : q;
q = s;
} else q = q.call(t);
} catch (r) {
return e(r);
}
}
};
};
}
if (!$asyncbind.LazyThenable) {
$asyncbind.LazyThenable = function () {
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === "function";
}
function resolution(p, r, how) {
try {
tick = process.nextTick;
var x = how ? how(r) : r;
if (p === x) return p.reject(new TypeError("Promise resolution loop"));
if (isThenable(x)) {
x.then(function (y) {
resolution(p, y);
}, function (e) {
p.reject(e);
});
} else {
p.resolve(x);
}
} catch (ex) {
tick = function tick(p) {
setTimeout(p, 0);
};
p.reject(ex);
}
}
function _untask() {
for (var i = 0; i < _tasks.length; i += 2) {
var t = _tasks[i + 1],
r = _tasks[i];
function Chained() {}
for (var j = 0; j < t.length; j++) t[j].call(null, r);
;
Chained.prototype = {
resolve: _unchained,
reject: _unchained,
then: thenChain
};
function _unchained(v) {}
function thenChain(res, rej) {
this.resolve = res;
this.reject = rej;
}
function then(res, rej) {
var chain = new Chained();
try {
this._resolver(function (value) {
return isThenable(value) ? value.then(res, rej) : resolution(chain, value, res);
}, function (ex) {
resolution(chain, ex, rej);
});
} catch (ex) {
resolution(chain, ex, rej);
}
_tasks = [];
return chain;
}
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === 'function';
function Thenable(resolver) {
this._resolver = resolver;
this.then = then;
}
function EagerThenable(resolver) {
function done(inline) {
var w;
if (_sync || phase < 0 || (w = _thens[phase]).length === 0) return;
;
_tasks.push(result, w);
Thenable.resolve = function (v) {
return Thenable.isThenable(v) ? v : {
then: function then(resolve) {
return resolve(v);
}
};
};
_thens = [[], []];
if (_tasks.length === 2) inline ? _untask() : tick(_untask);
}
Thenable.isThenable = isThenable;
return Thenable;
}();
function resolveThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 0;
result = x;
done(true);
$asyncbind.EagerThenable = $asyncbind.Thenable = ($asyncbind.EagerThenableFactory = function (tick) {
tick = tick || typeof process === "object" && process.nextTick || typeof setImmediate === "function" && setImmediate || function (f) {
setTimeout(f, 0);
};
var soon = function () {
var fq = [],
fqStart = 0,
bufferSize = 1024;
function callQueue() {
while (fq.length - fqStart) {
fq[fqStart]();
fq[fqStart++] = undefined;
if (fqStart === bufferSize) {
fq.splice(0, bufferSize);
fqStart = 0;
}
}
}
function rejectThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 1;
result = x;
done(true);
return function (fn) {
fq.push(fn);
if (fq.length - fqStart === 1) tick(callQueue);
};
}();
function Zousan(func) {
if (func) {
var me = this;
func(function (arg) {
me.resolve(arg);
}, function (arg) {
me.reject(arg);
});
}
}
function settler(resolver, rejecter) {
_thens[0].push(resolver);
Zousan.prototype = {
resolve: function resolve(value) {
if (this.state !== undefined) return;
if (value === this) return this.reject(new TypeError("Attempt to resolve promise with self"));
var me = this;
_thens[1].push(rejecter);
if (value && (typeof value === "function" || typeof value === "object")) {
try {
var first = 0;
var then = value.then;
done();
}
if (typeof then === "function") {
then.call(value, function (ra) {
if (!first++) {
me.resolve(ra);
}
}, function (rr) {
if (!first++) {
me.reject(rr);
}
});
return;
}
} catch (e) {
if (!first) this.reject(e);
return;
}
}
function toString() {
return 'EagerThenable{' + {
'-1': 'pending',
0: 'resolved',
1: 'rejected'
}[phase] + '}=' + result.toString();
this.state = STATE_FULFILLED;
this.v = value;
if (me.c) soon(function () {
for (var n = 0, l = me.c.length; n < l; n++) STATE_FULFILLED(me.c[n], value);
});
},
reject: function reject(reason) {
if (this.state !== undefined) return;
this.state = STATE_REJECTED;
this.v = reason;
var clients = this.c;
if (clients) soon(function () {
for (var n = 0, l = clients.length; n < l; n++) STATE_REJECTED(clients[n], reason);
});
},
then: function then(onF, onR) {
var p = new Zousan();
var client = {
y: onF,
n: onR,
p: p
};
if (this.state === undefined) {
if (this.c) this.c.push(client);else this.c = [client];
} else {
var s = this.state,
a = this.v;
soon(function () {
s(client, a);
});
}
return p;
}
};
function guard() {
function STATE_FULFILLED(c, arg) {
if (typeof c.y === "function") {
try {
resolver.call(null, resolveThen, rejectThen);
} catch (ex) {
rejectThen(ex);
var yret = c.y.call(undefined, arg);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
}
} else c.p.resolve(arg);
}
this.then = settler;
this.toString = toString;
var _thens = [[], []],
_sync = true,
phase = -1,
result;
guard();
_sync = false;
done();
function STATE_REJECTED(c, reason) {
if (typeof c.n === "function") {
try {
var yret = c.n.call(undefined, reason);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
} else c.p.reject(reason);
}
EagerThenable.resolve = function (v) {
return isThenable(v) ? v : {
then: function then(resolve, reject) {
return resolve(v);
}
};
Zousan.resolve = function (val) {
if (val && val instanceof Zousan) return val;
var z = new Zousan();
z.resolve(val);
return z;
};
return EagerThenable;
}();
return new Function.prototype.$asyncbind.EagerThenable(boundThen);
}
Zousan.reject = function (err) {
if (err && err instanceof Zousan) return err;
var z = new Zousan();
z.reject(err);
return z;
};
if (catcher) {
if (Function.prototype.$asyncbind.wrapAsyncStack) catcher = Function.prototype.$asyncbind.wrapAsyncStack(catcher);
return then;
Zousan.version = "2.3.2-nodent";
return Zousan;
})();
}
function then(result, error) {
try {
return result && result instanceof Object && typeof result.then === 'function' ? result.then(then, catcher) : resolver.call(self, result, error || catcher);
} catch (ex) {
return (error || catcher)(ex);
}
var resolver = this;
switch (catcher) {
case true:
return new $asyncbind.Thenable(boundThen);
case 0:
return new $asyncbind.LazyThenable(boundThen);
case undefined:
boundThen.then = boundThen;
return boundThen;
default:
return function () {
try {
return resolver.apply(self, arguments);
} catch (ex) {
return catcher(ex);
}
};
}
function boundThen(result, error) {
return resolver.call(self, result, error);
function boundThen() {
return resolver.apply(self, arguments);
}
boundThen.then = boundThen;
return boundThen;
};

@@ -146,0 +302,0 @@

@@ -10,128 +10,284 @@ 'use babel';

Function.prototype.$asyncbind = function anonymous(self, catcher) {
var resolver = this;
Function.prototype.$asyncbind = function $asyncbind(self, catcher) {
"use strict";
if (catcher === true) {
if (!Function.prototype.$asyncbind.EagerThenable) Function.prototype.$asyncbind.EagerThenable = function factory(tick) {
var _tasks = [];
if (!Function.prototype.$asyncbind) {
Object.defineProperty(Function.prototype, "$asyncbind", {
value: $asyncbind,
enumerable: false,
configurable: true,
writable: true
});
}
if (!tick) {
if (!$asyncbind.trampoline) {
$asyncbind.trampoline = function trampoline(t, x, s, e, u) {
return function b(q) {
while (q) {
if (q.then) {
q = q.then(b, e);
return u ? undefined : q;
}
try {
if (q.pop) {
if (q.length) return q.pop() ? x.call(t) : q;
q = s;
} else q = q.call(t);
} catch (r) {
return e(r);
}
}
};
};
}
if (!$asyncbind.LazyThenable) {
$asyncbind.LazyThenable = function () {
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === "function";
}
function resolution(p, r, how) {
try {
tick = process.nextTick;
var x = how ? how(r) : r;
if (p === x) return p.reject(new TypeError("Promise resolution loop"));
if (isThenable(x)) {
x.then(function (y) {
resolution(p, y);
}, function (e) {
p.reject(e);
});
} else {
p.resolve(x);
}
} catch (ex) {
tick = function tick(p) {
setTimeout(p, 0);
};
p.reject(ex);
}
}
function _untask() {
for (var i = 0; i < _tasks.length; i += 2) {
var t = _tasks[i + 1],
r = _tasks[i];
function Chained() {}
for (var j = 0; j < t.length; j++) t[j].call(null, r);
;
Chained.prototype = {
resolve: _unchained,
reject: _unchained,
then: thenChain
};
function _unchained(v) {}
function thenChain(res, rej) {
this.resolve = res;
this.reject = rej;
}
function then(res, rej) {
var chain = new Chained();
try {
this._resolver(function (value) {
return isThenable(value) ? value.then(res, rej) : resolution(chain, value, res);
}, function (ex) {
resolution(chain, ex, rej);
});
} catch (ex) {
resolution(chain, ex, rej);
}
_tasks = [];
return chain;
}
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === 'function';
function Thenable(resolver) {
this._resolver = resolver;
this.then = then;
}
function EagerThenable(resolver) {
function done(inline) {
var w;
if (_sync || phase < 0 || (w = _thens[phase]).length === 0) return;
;
_tasks.push(result, w);
Thenable.resolve = function (v) {
return Thenable.isThenable(v) ? v : {
then: function then(resolve) {
return resolve(v);
}
};
};
_thens = [[], []];
if (_tasks.length === 2) inline ? _untask() : tick(_untask);
}
Thenable.isThenable = isThenable;
return Thenable;
}();
function resolveThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 0;
result = x;
done(true);
$asyncbind.EagerThenable = $asyncbind.Thenable = ($asyncbind.EagerThenableFactory = function (tick) {
tick = tick || typeof process === "object" && process.nextTick || typeof setImmediate === "function" && setImmediate || function (f) {
setTimeout(f, 0);
};
var soon = function () {
var fq = [],
fqStart = 0,
bufferSize = 1024;
function callQueue() {
while (fq.length - fqStart) {
fq[fqStart]();
fq[fqStart++] = undefined;
if (fqStart === bufferSize) {
fq.splice(0, bufferSize);
fqStart = 0;
}
}
}
function rejectThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 1;
result = x;
done(true);
return function (fn) {
fq.push(fn);
if (fq.length - fqStart === 1) tick(callQueue);
};
}();
function Zousan(func) {
if (func) {
var me = this;
func(function (arg) {
me.resolve(arg);
}, function (arg) {
me.reject(arg);
});
}
}
function settler(resolver, rejecter) {
_thens[0].push(resolver);
Zousan.prototype = {
resolve: function resolve(value) {
if (this.state !== undefined) return;
if (value === this) return this.reject(new TypeError("Attempt to resolve promise with self"));
var me = this;
_thens[1].push(rejecter);
if (value && (typeof value === "function" || typeof value === "object")) {
try {
var first = 0;
var then = value.then;
done();
}
if (typeof then === "function") {
then.call(value, function (ra) {
if (!first++) {
me.resolve(ra);
}
}, function (rr) {
if (!first++) {
me.reject(rr);
}
});
return;
}
} catch (e) {
if (!first) this.reject(e);
return;
}
}
function toString() {
return 'EagerThenable{' + {
'-1': 'pending',
0: 'resolved',
1: 'rejected'
}[phase] + '}=' + result.toString();
this.state = STATE_FULFILLED;
this.v = value;
if (me.c) soon(function () {
for (var n = 0, l = me.c.length; n < l; n++) STATE_FULFILLED(me.c[n], value);
});
},
reject: function reject(reason) {
if (this.state !== undefined) return;
this.state = STATE_REJECTED;
this.v = reason;
var clients = this.c;
if (clients) soon(function () {
for (var n = 0, l = clients.length; n < l; n++) STATE_REJECTED(clients[n], reason);
});
},
then: function then(onF, onR) {
var p = new Zousan();
var client = {
y: onF,
n: onR,
p: p
};
if (this.state === undefined) {
if (this.c) this.c.push(client);else this.c = [client];
} else {
var s = this.state,
a = this.v;
soon(function () {
s(client, a);
});
}
return p;
}
};
function guard() {
function STATE_FULFILLED(c, arg) {
if (typeof c.y === "function") {
try {
resolver.call(null, resolveThen, rejectThen);
} catch (ex) {
rejectThen(ex);
var yret = c.y.call(undefined, arg);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
}
} else c.p.resolve(arg);
}
this.then = settler;
this.toString = toString;
var _thens = [[], []],
_sync = true,
phase = -1,
result;
guard();
_sync = false;
done();
function STATE_REJECTED(c, reason) {
if (typeof c.n === "function") {
try {
var yret = c.n.call(undefined, reason);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
} else c.p.reject(reason);
}
EagerThenable.resolve = function (v) {
return isThenable(v) ? v : {
then: function then(resolve, reject) {
return resolve(v);
}
};
Zousan.resolve = function (val) {
if (val && val instanceof Zousan) return val;
var z = new Zousan();
z.resolve(val);
return z;
};
return EagerThenable;
}();
return new Function.prototype.$asyncbind.EagerThenable(boundThen);
}
Zousan.reject = function (err) {
if (err && err instanceof Zousan) return err;
var z = new Zousan();
z.reject(err);
return z;
};
if (catcher) {
if (Function.prototype.$asyncbind.wrapAsyncStack) catcher = Function.prototype.$asyncbind.wrapAsyncStack(catcher);
return then;
Zousan.version = "2.3.2-nodent";
return Zousan;
})();
}
function then(result, error) {
try {
return result && result instanceof Object && typeof result.then === 'function' ? result.then(then, catcher) : resolver.call(self, result, error || catcher);
} catch (ex) {
return (error || catcher)(ex);
}
var resolver = this;
switch (catcher) {
case true:
return new $asyncbind.Thenable(boundThen);
case 0:
return new $asyncbind.LazyThenable(boundThen);
case undefined:
boundThen.then = boundThen;
return boundThen;
default:
return function () {
try {
return resolver.apply(self, arguments);
} catch (ex) {
return catcher(ex);
}
};
}
function boundThen(result, error) {
return resolver.call(self, result, error);
function boundThen() {
return resolver.apply(self, arguments);
}
boundThen.then = boundThen;
return boundThen;
};

@@ -154,3 +310,3 @@

const queue = this.queue.get(message.guild.id);
if (!queue) return $return(`There isn\'t any music playing to pause, oh brilliant one.`);
if (!queue) return $return('There isn\'t any music playing to pause, oh brilliant one.');
if (!queue.songs[0].dispatcher) return $return('It\'s kind of tough to pause a song that hasn\'t even begun playing yet.');

@@ -157,0 +313,0 @@ if (!queue.songs[0].playing) return $return('Pausing a song that is already paused is a bad move. I wouldn\'t recommend it.');

@@ -30,130 +30,2 @@ 'use babel';

Function.prototype.$asyncbind = function anonymous(self, catcher) {
var resolver = this;
if (catcher === true) {
if (!Function.prototype.$asyncbind.EagerThenable) Function.prototype.$asyncbind.EagerThenable = function factory(tick) {
var _tasks = [];
if (!tick) {
try {
tick = process.nextTick;
} catch (ex) {
tick = function tick(p) {
setTimeout(p, 0);
};
}
}
function _untask() {
for (var i = 0; i < _tasks.length; i += 2) {
var t = _tasks[i + 1],
r = _tasks[i];
for (var j = 0; j < t.length; j++) t[j].call(null, r);
}
_tasks = [];
}
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === 'function';
}
function EagerThenable(resolver) {
function done(inline) {
var w;
if (_sync || phase < 0 || (w = _thens[phase]).length === 0) return;
_tasks.push(result, w);
_thens = [[], []];
if (_tasks.length === 2) inline ? _untask() : tick(_untask);
}
function resolveThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 0;
result = x;
done(true);
}
function rejectThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 1;
result = x;
done(true);
}
function settler(resolver, rejecter) {
_thens[0].push(resolver);
_thens[1].push(rejecter);
done();
}
function toString() {
return 'EagerThenable{' + {
'-1': 'pending',
0: 'resolved',
1: 'rejected'
}[phase] + '}=' + result.toString();
}
function guard() {
try {
resolver.call(null, resolveThen, rejectThen);
} catch (ex) {
rejectThen(ex);
}
}
this.then = settler;
this.toString = toString;
var _thens = [[], []],
_sync = true,
phase = -1,
result;
guard();
_sync = false;
done();
}
EagerThenable.resolve = function (v) {
return isThenable(v) ? v : {
then: function then(resolve, reject) {
return resolve(v);
}
};
};
return EagerThenable;
}();
return new Function.prototype.$asyncbind.EagerThenable(boundThen);
}
if (catcher) {
if (Function.prototype.$asyncbind.wrapAsyncStack) catcher = Function.prototype.$asyncbind.wrapAsyncStack(catcher);
return then;
}
function then(result, error) {
try {
return result && result instanceof Object && typeof result.then === 'function' ? result.then(then, catcher) : resolver.call(self, result, error || catcher);
} catch (ex) {
return (error || catcher)(ex);
}
}
function boundThen(result, error) {
return resolver.call(self, result, error);
}
boundThen.then = boundThen;
return boundThen;
};
class PlaySongCommand extends _discordGraf.Command {

@@ -160,0 +32,0 @@ constructor(bot) {

@@ -22,128 +22,284 @@ 'use babel';

Function.prototype.$asyncbind = function anonymous(self, catcher) {
var resolver = this;
Function.prototype.$asyncbind = function $asyncbind(self, catcher) {
"use strict";
if (catcher === true) {
if (!Function.prototype.$asyncbind.EagerThenable) Function.prototype.$asyncbind.EagerThenable = function factory(tick) {
var _tasks = [];
if (!Function.prototype.$asyncbind) {
Object.defineProperty(Function.prototype, "$asyncbind", {
value: $asyncbind,
enumerable: false,
configurable: true,
writable: true
});
}
if (!tick) {
if (!$asyncbind.trampoline) {
$asyncbind.trampoline = function trampoline(t, x, s, e, u) {
return function b(q) {
while (q) {
if (q.then) {
q = q.then(b, e);
return u ? undefined : q;
}
try {
if (q.pop) {
if (q.length) return q.pop() ? x.call(t) : q;
q = s;
} else q = q.call(t);
} catch (r) {
return e(r);
}
}
};
};
}
if (!$asyncbind.LazyThenable) {
$asyncbind.LazyThenable = function () {
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === "function";
}
function resolution(p, r, how) {
try {
tick = process.nextTick;
var x = how ? how(r) : r;
if (p === x) return p.reject(new TypeError("Promise resolution loop"));
if (isThenable(x)) {
x.then(function (y) {
resolution(p, y);
}, function (e) {
p.reject(e);
});
} else {
p.resolve(x);
}
} catch (ex) {
tick = function tick(p) {
setTimeout(p, 0);
};
p.reject(ex);
}
}
function _untask() {
for (var i = 0; i < _tasks.length; i += 2) {
var t = _tasks[i + 1],
r = _tasks[i];
function Chained() {}
for (var j = 0; j < t.length; j++) t[j].call(null, r);
;
Chained.prototype = {
resolve: _unchained,
reject: _unchained,
then: thenChain
};
function _unchained(v) {}
function thenChain(res, rej) {
this.resolve = res;
this.reject = rej;
}
function then(res, rej) {
var chain = new Chained();
try {
this._resolver(function (value) {
return isThenable(value) ? value.then(res, rej) : resolution(chain, value, res);
}, function (ex) {
resolution(chain, ex, rej);
});
} catch (ex) {
resolution(chain, ex, rej);
}
_tasks = [];
return chain;
}
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === 'function';
function Thenable(resolver) {
this._resolver = resolver;
this.then = then;
}
function EagerThenable(resolver) {
function done(inline) {
var w;
if (_sync || phase < 0 || (w = _thens[phase]).length === 0) return;
;
_tasks.push(result, w);
Thenable.resolve = function (v) {
return Thenable.isThenable(v) ? v : {
then: function then(resolve) {
return resolve(v);
}
};
};
_thens = [[], []];
if (_tasks.length === 2) inline ? _untask() : tick(_untask);
}
Thenable.isThenable = isThenable;
return Thenable;
}();
function resolveThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 0;
result = x;
done(true);
$asyncbind.EagerThenable = $asyncbind.Thenable = ($asyncbind.EagerThenableFactory = function (tick) {
tick = tick || typeof process === "object" && process.nextTick || typeof setImmediate === "function" && setImmediate || function (f) {
setTimeout(f, 0);
};
var soon = function () {
var fq = [],
fqStart = 0,
bufferSize = 1024;
function callQueue() {
while (fq.length - fqStart) {
fq[fqStart]();
fq[fqStart++] = undefined;
if (fqStart === bufferSize) {
fq.splice(0, bufferSize);
fqStart = 0;
}
}
}
function rejectThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 1;
result = x;
done(true);
return function (fn) {
fq.push(fn);
if (fq.length - fqStart === 1) tick(callQueue);
};
}();
function Zousan(func) {
if (func) {
var me = this;
func(function (arg) {
me.resolve(arg);
}, function (arg) {
me.reject(arg);
});
}
}
function settler(resolver, rejecter) {
_thens[0].push(resolver);
Zousan.prototype = {
resolve: function resolve(value) {
if (this.state !== undefined) return;
if (value === this) return this.reject(new TypeError("Attempt to resolve promise with self"));
var me = this;
_thens[1].push(rejecter);
if (value && (typeof value === "function" || typeof value === "object")) {
try {
var first = 0;
var then = value.then;
done();
}
if (typeof then === "function") {
then.call(value, function (ra) {
if (!first++) {
me.resolve(ra);
}
}, function (rr) {
if (!first++) {
me.reject(rr);
}
});
return;
}
} catch (e) {
if (!first) this.reject(e);
return;
}
}
function toString() {
return 'EagerThenable{' + {
'-1': 'pending',
0: 'resolved',
1: 'rejected'
}[phase] + '}=' + result.toString();
this.state = STATE_FULFILLED;
this.v = value;
if (me.c) soon(function () {
for (var n = 0, l = me.c.length; n < l; n++) STATE_FULFILLED(me.c[n], value);
});
},
reject: function reject(reason) {
if (this.state !== undefined) return;
this.state = STATE_REJECTED;
this.v = reason;
var clients = this.c;
if (clients) soon(function () {
for (var n = 0, l = clients.length; n < l; n++) STATE_REJECTED(clients[n], reason);
});
},
then: function then(onF, onR) {
var p = new Zousan();
var client = {
y: onF,
n: onR,
p: p
};
if (this.state === undefined) {
if (this.c) this.c.push(client);else this.c = [client];
} else {
var s = this.state,
a = this.v;
soon(function () {
s(client, a);
});
}
return p;
}
};
function guard() {
function STATE_FULFILLED(c, arg) {
if (typeof c.y === "function") {
try {
resolver.call(null, resolveThen, rejectThen);
} catch (ex) {
rejectThen(ex);
var yret = c.y.call(undefined, arg);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
}
} else c.p.resolve(arg);
}
this.then = settler;
this.toString = toString;
var _thens = [[], []],
_sync = true,
phase = -1,
result;
guard();
_sync = false;
done();
function STATE_REJECTED(c, reason) {
if (typeof c.n === "function") {
try {
var yret = c.n.call(undefined, reason);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
} else c.p.reject(reason);
}
EagerThenable.resolve = function (v) {
return isThenable(v) ? v : {
then: function then(resolve, reject) {
return resolve(v);
}
};
Zousan.resolve = function (val) {
if (val && val instanceof Zousan) return val;
var z = new Zousan();
z.resolve(val);
return z;
};
return EagerThenable;
}();
return new Function.prototype.$asyncbind.EagerThenable(boundThen);
}
Zousan.reject = function (err) {
if (err && err instanceof Zousan) return err;
var z = new Zousan();
z.reject(err);
return z;
};
if (catcher) {
if (Function.prototype.$asyncbind.wrapAsyncStack) catcher = Function.prototype.$asyncbind.wrapAsyncStack(catcher);
return then;
Zousan.version = "2.3.2-nodent";
return Zousan;
})();
}
function then(result, error) {
try {
return result && result instanceof Object && typeof result.then === 'function' ? result.then(then, catcher) : resolver.call(self, result, error || catcher);
} catch (ex) {
return (error || catcher)(ex);
}
var resolver = this;
switch (catcher) {
case true:
return new $asyncbind.Thenable(boundThen);
case 0:
return new $asyncbind.LazyThenable(boundThen);
case undefined:
boundThen.then = boundThen;
return boundThen;
default:
return function () {
try {
return resolver.apply(self, arguments);
} catch (ex) {
return catcher(ex);
}
};
}
function boundThen(result, error) {
return resolver.call(self, result, error);
function boundThen() {
return resolver.apply(self, arguments);
}
boundThen.then = boundThen;
return boundThen;
};

@@ -150,0 +306,0 @@

@@ -10,128 +10,284 @@ 'use babel';

Function.prototype.$asyncbind = function anonymous(self, catcher) {
var resolver = this;
Function.prototype.$asyncbind = function $asyncbind(self, catcher) {
"use strict";
if (catcher === true) {
if (!Function.prototype.$asyncbind.EagerThenable) Function.prototype.$asyncbind.EagerThenable = function factory(tick) {
var _tasks = [];
if (!Function.prototype.$asyncbind) {
Object.defineProperty(Function.prototype, "$asyncbind", {
value: $asyncbind,
enumerable: false,
configurable: true,
writable: true
});
}
if (!tick) {
if (!$asyncbind.trampoline) {
$asyncbind.trampoline = function trampoline(t, x, s, e, u) {
return function b(q) {
while (q) {
if (q.then) {
q = q.then(b, e);
return u ? undefined : q;
}
try {
if (q.pop) {
if (q.length) return q.pop() ? x.call(t) : q;
q = s;
} else q = q.call(t);
} catch (r) {
return e(r);
}
}
};
};
}
if (!$asyncbind.LazyThenable) {
$asyncbind.LazyThenable = function () {
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === "function";
}
function resolution(p, r, how) {
try {
tick = process.nextTick;
var x = how ? how(r) : r;
if (p === x) return p.reject(new TypeError("Promise resolution loop"));
if (isThenable(x)) {
x.then(function (y) {
resolution(p, y);
}, function (e) {
p.reject(e);
});
} else {
p.resolve(x);
}
} catch (ex) {
tick = function tick(p) {
setTimeout(p, 0);
};
p.reject(ex);
}
}
function _untask() {
for (var i = 0; i < _tasks.length; i += 2) {
var t = _tasks[i + 1],
r = _tasks[i];
function Chained() {}
for (var j = 0; j < t.length; j++) t[j].call(null, r);
;
Chained.prototype = {
resolve: _unchained,
reject: _unchained,
then: thenChain
};
function _unchained(v) {}
function thenChain(res, rej) {
this.resolve = res;
this.reject = rej;
}
function then(res, rej) {
var chain = new Chained();
try {
this._resolver(function (value) {
return isThenable(value) ? value.then(res, rej) : resolution(chain, value, res);
}, function (ex) {
resolution(chain, ex, rej);
});
} catch (ex) {
resolution(chain, ex, rej);
}
_tasks = [];
return chain;
}
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === 'function';
function Thenable(resolver) {
this._resolver = resolver;
this.then = then;
}
function EagerThenable(resolver) {
function done(inline) {
var w;
if (_sync || phase < 0 || (w = _thens[phase]).length === 0) return;
;
_tasks.push(result, w);
Thenable.resolve = function (v) {
return Thenable.isThenable(v) ? v : {
then: function then(resolve) {
return resolve(v);
}
};
};
_thens = [[], []];
if (_tasks.length === 2) inline ? _untask() : tick(_untask);
}
Thenable.isThenable = isThenable;
return Thenable;
}();
function resolveThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 0;
result = x;
done(true);
$asyncbind.EagerThenable = $asyncbind.Thenable = ($asyncbind.EagerThenableFactory = function (tick) {
tick = tick || typeof process === "object" && process.nextTick || typeof setImmediate === "function" && setImmediate || function (f) {
setTimeout(f, 0);
};
var soon = function () {
var fq = [],
fqStart = 0,
bufferSize = 1024;
function callQueue() {
while (fq.length - fqStart) {
fq[fqStart]();
fq[fqStart++] = undefined;
if (fqStart === bufferSize) {
fq.splice(0, bufferSize);
fqStart = 0;
}
}
}
function rejectThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 1;
result = x;
done(true);
return function (fn) {
fq.push(fn);
if (fq.length - fqStart === 1) tick(callQueue);
};
}();
function Zousan(func) {
if (func) {
var me = this;
func(function (arg) {
me.resolve(arg);
}, function (arg) {
me.reject(arg);
});
}
}
function settler(resolver, rejecter) {
_thens[0].push(resolver);
Zousan.prototype = {
resolve: function resolve(value) {
if (this.state !== undefined) return;
if (value === this) return this.reject(new TypeError("Attempt to resolve promise with self"));
var me = this;
_thens[1].push(rejecter);
if (value && (typeof value === "function" || typeof value === "object")) {
try {
var first = 0;
var then = value.then;
done();
}
if (typeof then === "function") {
then.call(value, function (ra) {
if (!first++) {
me.resolve(ra);
}
}, function (rr) {
if (!first++) {
me.reject(rr);
}
});
return;
}
} catch (e) {
if (!first) this.reject(e);
return;
}
}
function toString() {
return 'EagerThenable{' + {
'-1': 'pending',
0: 'resolved',
1: 'rejected'
}[phase] + '}=' + result.toString();
this.state = STATE_FULFILLED;
this.v = value;
if (me.c) soon(function () {
for (var n = 0, l = me.c.length; n < l; n++) STATE_FULFILLED(me.c[n], value);
});
},
reject: function reject(reason) {
if (this.state !== undefined) return;
this.state = STATE_REJECTED;
this.v = reason;
var clients = this.c;
if (clients) soon(function () {
for (var n = 0, l = clients.length; n < l; n++) STATE_REJECTED(clients[n], reason);
});
},
then: function then(onF, onR) {
var p = new Zousan();
var client = {
y: onF,
n: onR,
p: p
};
if (this.state === undefined) {
if (this.c) this.c.push(client);else this.c = [client];
} else {
var s = this.state,
a = this.v;
soon(function () {
s(client, a);
});
}
return p;
}
};
function guard() {
function STATE_FULFILLED(c, arg) {
if (typeof c.y === "function") {
try {
resolver.call(null, resolveThen, rejectThen);
} catch (ex) {
rejectThen(ex);
var yret = c.y.call(undefined, arg);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
}
} else c.p.resolve(arg);
}
this.then = settler;
this.toString = toString;
var _thens = [[], []],
_sync = true,
phase = -1,
result;
guard();
_sync = false;
done();
function STATE_REJECTED(c, reason) {
if (typeof c.n === "function") {
try {
var yret = c.n.call(undefined, reason);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
} else c.p.reject(reason);
}
EagerThenable.resolve = function (v) {
return isThenable(v) ? v : {
then: function then(resolve, reject) {
return resolve(v);
}
};
Zousan.resolve = function (val) {
if (val && val instanceof Zousan) return val;
var z = new Zousan();
z.resolve(val);
return z;
};
return EagerThenable;
}();
return new Function.prototype.$asyncbind.EagerThenable(boundThen);
}
Zousan.reject = function (err) {
if (err && err instanceof Zousan) return err;
var z = new Zousan();
z.reject(err);
return z;
};
if (catcher) {
if (Function.prototype.$asyncbind.wrapAsyncStack) catcher = Function.prototype.$asyncbind.wrapAsyncStack(catcher);
return then;
Zousan.version = "2.3.2-nodent";
return Zousan;
})();
}
function then(result, error) {
try {
return result && result instanceof Object && typeof result.then === 'function' ? result.then(then, catcher) : resolver.call(self, result, error || catcher);
} catch (ex) {
return (error || catcher)(ex);
}
var resolver = this;
switch (catcher) {
case true:
return new $asyncbind.Thenable(boundThen);
case 0:
return new $asyncbind.LazyThenable(boundThen);
case undefined:
boundThen.then = boundThen;
return boundThen;
default:
return function () {
try {
return resolver.apply(self, arguments);
} catch (ex) {
return catcher(ex);
}
};
}
function boundThen(result, error) {
return resolver.call(self, result, error);
function boundThen() {
return resolver.apply(self, arguments);
}
boundThen.then = boundThen;
return boundThen;
};

@@ -153,3 +309,3 @@

const queue = this.queue.get(message.guild.id);
if (!queue) return $return(`There isn\'t any music playing to resume, oh brilliant one.`);
if (!queue) return $return('There isn\'t any music playing to resume, oh brilliant one.');
if (!queue.songs[0].dispatcher) {

@@ -156,0 +312,0 @@ return $return('Pretty sure a song that hasn\'t actually begun playing yet could be considered "resumed".');

@@ -12,128 +12,284 @@ 'use babel';

Function.prototype.$asyncbind = function anonymous(self, catcher) {
var resolver = this;
Function.prototype.$asyncbind = function $asyncbind(self, catcher) {
"use strict";
if (catcher === true) {
if (!Function.prototype.$asyncbind.EagerThenable) Function.prototype.$asyncbind.EagerThenable = function factory(tick) {
var _tasks = [];
if (!Function.prototype.$asyncbind) {
Object.defineProperty(Function.prototype, "$asyncbind", {
value: $asyncbind,
enumerable: false,
configurable: true,
writable: true
});
}
if (!tick) {
if (!$asyncbind.trampoline) {
$asyncbind.trampoline = function trampoline(t, x, s, e, u) {
return function b(q) {
while (q) {
if (q.then) {
q = q.then(b, e);
return u ? undefined : q;
}
try {
if (q.pop) {
if (q.length) return q.pop() ? x.call(t) : q;
q = s;
} else q = q.call(t);
} catch (r) {
return e(r);
}
}
};
};
}
if (!$asyncbind.LazyThenable) {
$asyncbind.LazyThenable = function () {
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === "function";
}
function resolution(p, r, how) {
try {
tick = process.nextTick;
var x = how ? how(r) : r;
if (p === x) return p.reject(new TypeError("Promise resolution loop"));
if (isThenable(x)) {
x.then(function (y) {
resolution(p, y);
}, function (e) {
p.reject(e);
});
} else {
p.resolve(x);
}
} catch (ex) {
tick = function tick(p) {
setTimeout(p, 0);
};
p.reject(ex);
}
}
function _untask() {
for (var i = 0; i < _tasks.length; i += 2) {
var t = _tasks[i + 1],
r = _tasks[i];
function Chained() {}
for (var j = 0; j < t.length; j++) t[j].call(null, r);
;
Chained.prototype = {
resolve: _unchained,
reject: _unchained,
then: thenChain
};
function _unchained(v) {}
function thenChain(res, rej) {
this.resolve = res;
this.reject = rej;
}
function then(res, rej) {
var chain = new Chained();
try {
this._resolver(function (value) {
return isThenable(value) ? value.then(res, rej) : resolution(chain, value, res);
}, function (ex) {
resolution(chain, ex, rej);
});
} catch (ex) {
resolution(chain, ex, rej);
}
_tasks = [];
return chain;
}
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === 'function';
function Thenable(resolver) {
this._resolver = resolver;
this.then = then;
}
function EagerThenable(resolver) {
function done(inline) {
var w;
if (_sync || phase < 0 || (w = _thens[phase]).length === 0) return;
;
_tasks.push(result, w);
Thenable.resolve = function (v) {
return Thenable.isThenable(v) ? v : {
then: function then(resolve) {
return resolve(v);
}
};
};
_thens = [[], []];
if (_tasks.length === 2) inline ? _untask() : tick(_untask);
}
Thenable.isThenable = isThenable;
return Thenable;
}();
function resolveThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 0;
result = x;
done(true);
$asyncbind.EagerThenable = $asyncbind.Thenable = ($asyncbind.EagerThenableFactory = function (tick) {
tick = tick || typeof process === "object" && process.nextTick || typeof setImmediate === "function" && setImmediate || function (f) {
setTimeout(f, 0);
};
var soon = function () {
var fq = [],
fqStart = 0,
bufferSize = 1024;
function callQueue() {
while (fq.length - fqStart) {
fq[fqStart]();
fq[fqStart++] = undefined;
if (fqStart === bufferSize) {
fq.splice(0, bufferSize);
fqStart = 0;
}
}
}
function rejectThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 1;
result = x;
done(true);
return function (fn) {
fq.push(fn);
if (fq.length - fqStart === 1) tick(callQueue);
};
}();
function Zousan(func) {
if (func) {
var me = this;
func(function (arg) {
me.resolve(arg);
}, function (arg) {
me.reject(arg);
});
}
}
function settler(resolver, rejecter) {
_thens[0].push(resolver);
Zousan.prototype = {
resolve: function resolve(value) {
if (this.state !== undefined) return;
if (value === this) return this.reject(new TypeError("Attempt to resolve promise with self"));
var me = this;
_thens[1].push(rejecter);
if (value && (typeof value === "function" || typeof value === "object")) {
try {
var first = 0;
var then = value.then;
done();
}
if (typeof then === "function") {
then.call(value, function (ra) {
if (!first++) {
me.resolve(ra);
}
}, function (rr) {
if (!first++) {
me.reject(rr);
}
});
return;
}
} catch (e) {
if (!first) this.reject(e);
return;
}
}
function toString() {
return 'EagerThenable{' + {
'-1': 'pending',
0: 'resolved',
1: 'rejected'
}[phase] + '}=' + result.toString();
this.state = STATE_FULFILLED;
this.v = value;
if (me.c) soon(function () {
for (var n = 0, l = me.c.length; n < l; n++) STATE_FULFILLED(me.c[n], value);
});
},
reject: function reject(reason) {
if (this.state !== undefined) return;
this.state = STATE_REJECTED;
this.v = reason;
var clients = this.c;
if (clients) soon(function () {
for (var n = 0, l = clients.length; n < l; n++) STATE_REJECTED(clients[n], reason);
});
},
then: function then(onF, onR) {
var p = new Zousan();
var client = {
y: onF,
n: onR,
p: p
};
if (this.state === undefined) {
if (this.c) this.c.push(client);else this.c = [client];
} else {
var s = this.state,
a = this.v;
soon(function () {
s(client, a);
});
}
return p;
}
};
function guard() {
function STATE_FULFILLED(c, arg) {
if (typeof c.y === "function") {
try {
resolver.call(null, resolveThen, rejectThen);
} catch (ex) {
rejectThen(ex);
var yret = c.y.call(undefined, arg);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
}
} else c.p.resolve(arg);
}
this.then = settler;
this.toString = toString;
var _thens = [[], []],
_sync = true,
phase = -1,
result;
guard();
_sync = false;
done();
function STATE_REJECTED(c, reason) {
if (typeof c.n === "function") {
try {
var yret = c.n.call(undefined, reason);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
} else c.p.reject(reason);
}
EagerThenable.resolve = function (v) {
return isThenable(v) ? v : {
then: function then(resolve, reject) {
return resolve(v);
}
};
Zousan.resolve = function (val) {
if (val && val instanceof Zousan) return val;
var z = new Zousan();
z.resolve(val);
return z;
};
return EagerThenable;
}();
return new Function.prototype.$asyncbind.EagerThenable(boundThen);
}
Zousan.reject = function (err) {
if (err && err instanceof Zousan) return err;
var z = new Zousan();
z.reject(err);
return z;
};
if (catcher) {
if (Function.prototype.$asyncbind.wrapAsyncStack) catcher = Function.prototype.$asyncbind.wrapAsyncStack(catcher);
return then;
Zousan.version = "2.3.2-nodent";
return Zousan;
})();
}
function then(result, error) {
try {
return result && result instanceof Object && typeof result.then === 'function' ? result.then(then, catcher) : resolver.call(self, result, error || catcher);
} catch (ex) {
return (error || catcher)(ex);
}
var resolver = this;
switch (catcher) {
case true:
return new $asyncbind.Thenable(boundThen);
case 0:
return new $asyncbind.LazyThenable(boundThen);
case undefined:
boundThen.then = boundThen;
return boundThen;
default:
return function () {
try {
return resolver.apply(self, arguments);
} catch (ex) {
return catcher(ex);
}
};
}
function boundThen(result, error) {
return resolver.call(self, result, error);
function boundThen() {
return resolver.apply(self, arguments);
}
boundThen.then = boundThen;
return boundThen;
};

@@ -140,0 +296,0 @@

@@ -18,128 +18,284 @@ 'use babel';

Function.prototype.$asyncbind = function anonymous(self, catcher) {
var resolver = this;
Function.prototype.$asyncbind = function $asyncbind(self, catcher) {
"use strict";
if (catcher === true) {
if (!Function.prototype.$asyncbind.EagerThenable) Function.prototype.$asyncbind.EagerThenable = function factory(tick) {
var _tasks = [];
if (!Function.prototype.$asyncbind) {
Object.defineProperty(Function.prototype, "$asyncbind", {
value: $asyncbind,
enumerable: false,
configurable: true,
writable: true
});
}
if (!tick) {
if (!$asyncbind.trampoline) {
$asyncbind.trampoline = function trampoline(t, x, s, e, u) {
return function b(q) {
while (q) {
if (q.then) {
q = q.then(b, e);
return u ? undefined : q;
}
try {
if (q.pop) {
if (q.length) return q.pop() ? x.call(t) : q;
q = s;
} else q = q.call(t);
} catch (r) {
return e(r);
}
}
};
};
}
if (!$asyncbind.LazyThenable) {
$asyncbind.LazyThenable = function () {
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === "function";
}
function resolution(p, r, how) {
try {
tick = process.nextTick;
var x = how ? how(r) : r;
if (p === x) return p.reject(new TypeError("Promise resolution loop"));
if (isThenable(x)) {
x.then(function (y) {
resolution(p, y);
}, function (e) {
p.reject(e);
});
} else {
p.resolve(x);
}
} catch (ex) {
tick = function tick(p) {
setTimeout(p, 0);
};
p.reject(ex);
}
}
function _untask() {
for (var i = 0; i < _tasks.length; i += 2) {
var t = _tasks[i + 1],
r = _tasks[i];
function Chained() {}
for (var j = 0; j < t.length; j++) t[j].call(null, r);
;
Chained.prototype = {
resolve: _unchained,
reject: _unchained,
then: thenChain
};
function _unchained(v) {}
function thenChain(res, rej) {
this.resolve = res;
this.reject = rej;
}
function then(res, rej) {
var chain = new Chained();
try {
this._resolver(function (value) {
return isThenable(value) ? value.then(res, rej) : resolution(chain, value, res);
}, function (ex) {
resolution(chain, ex, rej);
});
} catch (ex) {
resolution(chain, ex, rej);
}
_tasks = [];
return chain;
}
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === 'function';
function Thenable(resolver) {
this._resolver = resolver;
this.then = then;
}
function EagerThenable(resolver) {
function done(inline) {
var w;
if (_sync || phase < 0 || (w = _thens[phase]).length === 0) return;
;
_tasks.push(result, w);
Thenable.resolve = function (v) {
return Thenable.isThenable(v) ? v : {
then: function then(resolve) {
return resolve(v);
}
};
};
_thens = [[], []];
if (_tasks.length === 2) inline ? _untask() : tick(_untask);
}
Thenable.isThenable = isThenable;
return Thenable;
}();
function resolveThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 0;
result = x;
done(true);
$asyncbind.EagerThenable = $asyncbind.Thenable = ($asyncbind.EagerThenableFactory = function (tick) {
tick = tick || typeof process === "object" && process.nextTick || typeof setImmediate === "function" && setImmediate || function (f) {
setTimeout(f, 0);
};
var soon = function () {
var fq = [],
fqStart = 0,
bufferSize = 1024;
function callQueue() {
while (fq.length - fqStart) {
fq[fqStart]();
fq[fqStart++] = undefined;
if (fqStart === bufferSize) {
fq.splice(0, bufferSize);
fqStart = 0;
}
}
}
function rejectThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 1;
result = x;
done(true);
return function (fn) {
fq.push(fn);
if (fq.length - fqStart === 1) tick(callQueue);
};
}();
function Zousan(func) {
if (func) {
var me = this;
func(function (arg) {
me.resolve(arg);
}, function (arg) {
me.reject(arg);
});
}
}
function settler(resolver, rejecter) {
_thens[0].push(resolver);
Zousan.prototype = {
resolve: function resolve(value) {
if (this.state !== undefined) return;
if (value === this) return this.reject(new TypeError("Attempt to resolve promise with self"));
var me = this;
_thens[1].push(rejecter);
if (value && (typeof value === "function" || typeof value === "object")) {
try {
var first = 0;
var then = value.then;
done();
}
if (typeof then === "function") {
then.call(value, function (ra) {
if (!first++) {
me.resolve(ra);
}
}, function (rr) {
if (!first++) {
me.reject(rr);
}
});
return;
}
} catch (e) {
if (!first) this.reject(e);
return;
}
}
function toString() {
return 'EagerThenable{' + {
'-1': 'pending',
0: 'resolved',
1: 'rejected'
}[phase] + '}=' + result.toString();
this.state = STATE_FULFILLED;
this.v = value;
if (me.c) soon(function () {
for (var n = 0, l = me.c.length; n < l; n++) STATE_FULFILLED(me.c[n], value);
});
},
reject: function reject(reason) {
if (this.state !== undefined) return;
this.state = STATE_REJECTED;
this.v = reason;
var clients = this.c;
if (clients) soon(function () {
for (var n = 0, l = clients.length; n < l; n++) STATE_REJECTED(clients[n], reason);
});
},
then: function then(onF, onR) {
var p = new Zousan();
var client = {
y: onF,
n: onR,
p: p
};
if (this.state === undefined) {
if (this.c) this.c.push(client);else this.c = [client];
} else {
var s = this.state,
a = this.v;
soon(function () {
s(client, a);
});
}
return p;
}
};
function guard() {
function STATE_FULFILLED(c, arg) {
if (typeof c.y === "function") {
try {
resolver.call(null, resolveThen, rejectThen);
} catch (ex) {
rejectThen(ex);
var yret = c.y.call(undefined, arg);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
}
} else c.p.resolve(arg);
}
this.then = settler;
this.toString = toString;
var _thens = [[], []],
_sync = true,
phase = -1,
result;
guard();
_sync = false;
done();
function STATE_REJECTED(c, reason) {
if (typeof c.n === "function") {
try {
var yret = c.n.call(undefined, reason);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
} else c.p.reject(reason);
}
EagerThenable.resolve = function (v) {
return isThenable(v) ? v : {
then: function then(resolve, reject) {
return resolve(v);
}
};
Zousan.resolve = function (val) {
if (val && val instanceof Zousan) return val;
var z = new Zousan();
z.resolve(val);
return z;
};
return EagerThenable;
}();
return new Function.prototype.$asyncbind.EagerThenable(boundThen);
}
Zousan.reject = function (err) {
if (err && err instanceof Zousan) return err;
var z = new Zousan();
z.reject(err);
return z;
};
if (catcher) {
if (Function.prototype.$asyncbind.wrapAsyncStack) catcher = Function.prototype.$asyncbind.wrapAsyncStack(catcher);
return then;
Zousan.version = "2.3.2-nodent";
return Zousan;
})();
}
function then(result, error) {
try {
return result && result instanceof Object && typeof result.then === 'function' ? result.then(then, catcher) : resolver.call(self, result, error || catcher);
} catch (ex) {
return (error || catcher)(ex);
}
var resolver = this;
switch (catcher) {
case true:
return new $asyncbind.Thenable(boundThen);
case 0:
return new $asyncbind.LazyThenable(boundThen);
case undefined:
boundThen.then = boundThen;
return boundThen;
default:
return function () {
try {
return resolver.apply(self, arguments);
} catch (ex) {
return catcher(ex);
}
};
}
function boundThen(result, error) {
return resolver.call(self, result, error);
function boundThen() {
return resolver.apply(self, arguments);
}
boundThen.then = boundThen;
return boundThen;
};

@@ -146,0 +302,0 @@

@@ -10,128 +10,284 @@ 'use babel';

Function.prototype.$asyncbind = function anonymous(self, catcher) {
var resolver = this;
Function.prototype.$asyncbind = function $asyncbind(self, catcher) {
"use strict";
if (catcher === true) {
if (!Function.prototype.$asyncbind.EagerThenable) Function.prototype.$asyncbind.EagerThenable = function factory(tick) {
var _tasks = [];
if (!Function.prototype.$asyncbind) {
Object.defineProperty(Function.prototype, "$asyncbind", {
value: $asyncbind,
enumerable: false,
configurable: true,
writable: true
});
}
if (!tick) {
if (!$asyncbind.trampoline) {
$asyncbind.trampoline = function trampoline(t, x, s, e, u) {
return function b(q) {
while (q) {
if (q.then) {
q = q.then(b, e);
return u ? undefined : q;
}
try {
if (q.pop) {
if (q.length) return q.pop() ? x.call(t) : q;
q = s;
} else q = q.call(t);
} catch (r) {
return e(r);
}
}
};
};
}
if (!$asyncbind.LazyThenable) {
$asyncbind.LazyThenable = function () {
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === "function";
}
function resolution(p, r, how) {
try {
tick = process.nextTick;
var x = how ? how(r) : r;
if (p === x) return p.reject(new TypeError("Promise resolution loop"));
if (isThenable(x)) {
x.then(function (y) {
resolution(p, y);
}, function (e) {
p.reject(e);
});
} else {
p.resolve(x);
}
} catch (ex) {
tick = function tick(p) {
setTimeout(p, 0);
};
p.reject(ex);
}
}
function _untask() {
for (var i = 0; i < _tasks.length; i += 2) {
var t = _tasks[i + 1],
r = _tasks[i];
function Chained() {}
for (var j = 0; j < t.length; j++) t[j].call(null, r);
;
Chained.prototype = {
resolve: _unchained,
reject: _unchained,
then: thenChain
};
function _unchained(v) {}
function thenChain(res, rej) {
this.resolve = res;
this.reject = rej;
}
function then(res, rej) {
var chain = new Chained();
try {
this._resolver(function (value) {
return isThenable(value) ? value.then(res, rej) : resolution(chain, value, res);
}, function (ex) {
resolution(chain, ex, rej);
});
} catch (ex) {
resolution(chain, ex, rej);
}
_tasks = [];
return chain;
}
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === 'function';
function Thenable(resolver) {
this._resolver = resolver;
this.then = then;
}
function EagerThenable(resolver) {
function done(inline) {
var w;
if (_sync || phase < 0 || (w = _thens[phase]).length === 0) return;
;
_tasks.push(result, w);
Thenable.resolve = function (v) {
return Thenable.isThenable(v) ? v : {
then: function then(resolve) {
return resolve(v);
}
};
};
_thens = [[], []];
if (_tasks.length === 2) inline ? _untask() : tick(_untask);
}
Thenable.isThenable = isThenable;
return Thenable;
}();
function resolveThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 0;
result = x;
done(true);
$asyncbind.EagerThenable = $asyncbind.Thenable = ($asyncbind.EagerThenableFactory = function (tick) {
tick = tick || typeof process === "object" && process.nextTick || typeof setImmediate === "function" && setImmediate || function (f) {
setTimeout(f, 0);
};
var soon = function () {
var fq = [],
fqStart = 0,
bufferSize = 1024;
function callQueue() {
while (fq.length - fqStart) {
fq[fqStart]();
fq[fqStart++] = undefined;
if (fqStart === bufferSize) {
fq.splice(0, bufferSize);
fqStart = 0;
}
}
}
function rejectThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 1;
result = x;
done(true);
return function (fn) {
fq.push(fn);
if (fq.length - fqStart === 1) tick(callQueue);
};
}();
function Zousan(func) {
if (func) {
var me = this;
func(function (arg) {
me.resolve(arg);
}, function (arg) {
me.reject(arg);
});
}
}
function settler(resolver, rejecter) {
_thens[0].push(resolver);
Zousan.prototype = {
resolve: function resolve(value) {
if (this.state !== undefined) return;
if (value === this) return this.reject(new TypeError("Attempt to resolve promise with self"));
var me = this;
_thens[1].push(rejecter);
if (value && (typeof value === "function" || typeof value === "object")) {
try {
var first = 0;
var then = value.then;
done();
}
if (typeof then === "function") {
then.call(value, function (ra) {
if (!first++) {
me.resolve(ra);
}
}, function (rr) {
if (!first++) {
me.reject(rr);
}
});
return;
}
} catch (e) {
if (!first) this.reject(e);
return;
}
}
function toString() {
return 'EagerThenable{' + {
'-1': 'pending',
0: 'resolved',
1: 'rejected'
}[phase] + '}=' + result.toString();
this.state = STATE_FULFILLED;
this.v = value;
if (me.c) soon(function () {
for (var n = 0, l = me.c.length; n < l; n++) STATE_FULFILLED(me.c[n], value);
});
},
reject: function reject(reason) {
if (this.state !== undefined) return;
this.state = STATE_REJECTED;
this.v = reason;
var clients = this.c;
if (clients) soon(function () {
for (var n = 0, l = clients.length; n < l; n++) STATE_REJECTED(clients[n], reason);
});
},
then: function then(onF, onR) {
var p = new Zousan();
var client = {
y: onF,
n: onR,
p: p
};
if (this.state === undefined) {
if (this.c) this.c.push(client);else this.c = [client];
} else {
var s = this.state,
a = this.v;
soon(function () {
s(client, a);
});
}
return p;
}
};
function guard() {
function STATE_FULFILLED(c, arg) {
if (typeof c.y === "function") {
try {
resolver.call(null, resolveThen, rejectThen);
} catch (ex) {
rejectThen(ex);
var yret = c.y.call(undefined, arg);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
}
} else c.p.resolve(arg);
}
this.then = settler;
this.toString = toString;
var _thens = [[], []],
_sync = true,
phase = -1,
result;
guard();
_sync = false;
done();
function STATE_REJECTED(c, reason) {
if (typeof c.n === "function") {
try {
var yret = c.n.call(undefined, reason);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
} else c.p.reject(reason);
}
EagerThenable.resolve = function (v) {
return isThenable(v) ? v : {
then: function then(resolve, reject) {
return resolve(v);
}
};
Zousan.resolve = function (val) {
if (val && val instanceof Zousan) return val;
var z = new Zousan();
z.resolve(val);
return z;
};
return EagerThenable;
}();
return new Function.prototype.$asyncbind.EagerThenable(boundThen);
}
Zousan.reject = function (err) {
if (err && err instanceof Zousan) return err;
var z = new Zousan();
z.reject(err);
return z;
};
if (catcher) {
if (Function.prototype.$asyncbind.wrapAsyncStack) catcher = Function.prototype.$asyncbind.wrapAsyncStack(catcher);
return then;
Zousan.version = "2.3.2-nodent";
return Zousan;
})();
}
function then(result, error) {
try {
return result && result instanceof Object && typeof result.then === 'function' ? result.then(then, catcher) : resolver.call(self, result, error || catcher);
} catch (ex) {
return (error || catcher)(ex);
}
var resolver = this;
switch (catcher) {
case true:
return new $asyncbind.Thenable(boundThen);
case 0:
return new $asyncbind.LazyThenable(boundThen);
case undefined:
boundThen.then = boundThen;
return boundThen;
default:
return function () {
try {
return resolver.apply(self, arguments);
} catch (ex) {
return catcher(ex);
}
};
}
function boundThen(result, error) {
return resolver.call(self, result, error);
function boundThen() {
return resolver.apply(self, arguments);
}
boundThen.then = boundThen;
return boundThen;
};

@@ -138,0 +294,0 @@

@@ -10,128 +10,284 @@ 'use babel';

Function.prototype.$asyncbind = function anonymous(self, catcher) {
var resolver = this;
Function.prototype.$asyncbind = function $asyncbind(self, catcher) {
"use strict";
if (catcher === true) {
if (!Function.prototype.$asyncbind.EagerThenable) Function.prototype.$asyncbind.EagerThenable = function factory(tick) {
var _tasks = [];
if (!Function.prototype.$asyncbind) {
Object.defineProperty(Function.prototype, "$asyncbind", {
value: $asyncbind,
enumerable: false,
configurable: true,
writable: true
});
}
if (!tick) {
if (!$asyncbind.trampoline) {
$asyncbind.trampoline = function trampoline(t, x, s, e, u) {
return function b(q) {
while (q) {
if (q.then) {
q = q.then(b, e);
return u ? undefined : q;
}
try {
if (q.pop) {
if (q.length) return q.pop() ? x.call(t) : q;
q = s;
} else q = q.call(t);
} catch (r) {
return e(r);
}
}
};
};
}
if (!$asyncbind.LazyThenable) {
$asyncbind.LazyThenable = function () {
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === "function";
}
function resolution(p, r, how) {
try {
tick = process.nextTick;
var x = how ? how(r) : r;
if (p === x) return p.reject(new TypeError("Promise resolution loop"));
if (isThenable(x)) {
x.then(function (y) {
resolution(p, y);
}, function (e) {
p.reject(e);
});
} else {
p.resolve(x);
}
} catch (ex) {
tick = function tick(p) {
setTimeout(p, 0);
};
p.reject(ex);
}
}
function _untask() {
for (var i = 0; i < _tasks.length; i += 2) {
var t = _tasks[i + 1],
r = _tasks[i];
function Chained() {}
for (var j = 0; j < t.length; j++) t[j].call(null, r);
;
Chained.prototype = {
resolve: _unchained,
reject: _unchained,
then: thenChain
};
function _unchained(v) {}
function thenChain(res, rej) {
this.resolve = res;
this.reject = rej;
}
function then(res, rej) {
var chain = new Chained();
try {
this._resolver(function (value) {
return isThenable(value) ? value.then(res, rej) : resolution(chain, value, res);
}, function (ex) {
resolution(chain, ex, rej);
});
} catch (ex) {
resolution(chain, ex, rej);
}
_tasks = [];
return chain;
}
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === 'function';
function Thenable(resolver) {
this._resolver = resolver;
this.then = then;
}
function EagerThenable(resolver) {
function done(inline) {
var w;
if (_sync || phase < 0 || (w = _thens[phase]).length === 0) return;
;
_tasks.push(result, w);
Thenable.resolve = function (v) {
return Thenable.isThenable(v) ? v : {
then: function then(resolve) {
return resolve(v);
}
};
};
_thens = [[], []];
if (_tasks.length === 2) inline ? _untask() : tick(_untask);
}
Thenable.isThenable = isThenable;
return Thenable;
}();
function resolveThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 0;
result = x;
done(true);
$asyncbind.EagerThenable = $asyncbind.Thenable = ($asyncbind.EagerThenableFactory = function (tick) {
tick = tick || typeof process === "object" && process.nextTick || typeof setImmediate === "function" && setImmediate || function (f) {
setTimeout(f, 0);
};
var soon = function () {
var fq = [],
fqStart = 0,
bufferSize = 1024;
function callQueue() {
while (fq.length - fqStart) {
fq[fqStart]();
fq[fqStart++] = undefined;
if (fqStart === bufferSize) {
fq.splice(0, bufferSize);
fqStart = 0;
}
}
}
function rejectThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 1;
result = x;
done(true);
return function (fn) {
fq.push(fn);
if (fq.length - fqStart === 1) tick(callQueue);
};
}();
function Zousan(func) {
if (func) {
var me = this;
func(function (arg) {
me.resolve(arg);
}, function (arg) {
me.reject(arg);
});
}
}
function settler(resolver, rejecter) {
_thens[0].push(resolver);
Zousan.prototype = {
resolve: function resolve(value) {
if (this.state !== undefined) return;
if (value === this) return this.reject(new TypeError("Attempt to resolve promise with self"));
var me = this;
_thens[1].push(rejecter);
if (value && (typeof value === "function" || typeof value === "object")) {
try {
var first = 0;
var then = value.then;
done();
}
if (typeof then === "function") {
then.call(value, function (ra) {
if (!first++) {
me.resolve(ra);
}
}, function (rr) {
if (!first++) {
me.reject(rr);
}
});
return;
}
} catch (e) {
if (!first) this.reject(e);
return;
}
}
function toString() {
return 'EagerThenable{' + {
'-1': 'pending',
0: 'resolved',
1: 'rejected'
}[phase] + '}=' + result.toString();
this.state = STATE_FULFILLED;
this.v = value;
if (me.c) soon(function () {
for (var n = 0, l = me.c.length; n < l; n++) STATE_FULFILLED(me.c[n], value);
});
},
reject: function reject(reason) {
if (this.state !== undefined) return;
this.state = STATE_REJECTED;
this.v = reason;
var clients = this.c;
if (clients) soon(function () {
for (var n = 0, l = clients.length; n < l; n++) STATE_REJECTED(clients[n], reason);
});
},
then: function then(onF, onR) {
var p = new Zousan();
var client = {
y: onF,
n: onR,
p: p
};
if (this.state === undefined) {
if (this.c) this.c.push(client);else this.c = [client];
} else {
var s = this.state,
a = this.v;
soon(function () {
s(client, a);
});
}
return p;
}
};
function guard() {
function STATE_FULFILLED(c, arg) {
if (typeof c.y === "function") {
try {
resolver.call(null, resolveThen, rejectThen);
} catch (ex) {
rejectThen(ex);
var yret = c.y.call(undefined, arg);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
}
} else c.p.resolve(arg);
}
this.then = settler;
this.toString = toString;
var _thens = [[], []],
_sync = true,
phase = -1,
result;
guard();
_sync = false;
done();
function STATE_REJECTED(c, reason) {
if (typeof c.n === "function") {
try {
var yret = c.n.call(undefined, reason);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
} else c.p.reject(reason);
}
EagerThenable.resolve = function (v) {
return isThenable(v) ? v : {
then: function then(resolve, reject) {
return resolve(v);
}
};
Zousan.resolve = function (val) {
if (val && val instanceof Zousan) return val;
var z = new Zousan();
z.resolve(val);
return z;
};
return EagerThenable;
}();
return new Function.prototype.$asyncbind.EagerThenable(boundThen);
}
Zousan.reject = function (err) {
if (err && err instanceof Zousan) return err;
var z = new Zousan();
z.reject(err);
return z;
};
if (catcher) {
if (Function.prototype.$asyncbind.wrapAsyncStack) catcher = Function.prototype.$asyncbind.wrapAsyncStack(catcher);
return then;
Zousan.version = "2.3.2-nodent";
return Zousan;
})();
}
function then(result, error) {
try {
return result && result instanceof Object && typeof result.then === 'function' ? result.then(then, catcher) : resolver.call(self, result, error || catcher);
} catch (ex) {
return (error || catcher)(ex);
}
var resolver = this;
switch (catcher) {
case true:
return new $asyncbind.Thenable(boundThen);
case 0:
return new $asyncbind.LazyThenable(boundThen);
case undefined:
boundThen.then = boundThen;
return boundThen;
default:
return function () {
try {
return resolver.apply(self, arguments);
} catch (ex) {
return catcher(ex);
}
};
}
function boundThen(result, error) {
return resolver.call(self, result, error);
function boundThen() {
return resolver.apply(self, arguments);
}
boundThen.then = boundThen;
return boundThen;
};

@@ -157,3 +313,3 @@

const queue = this.queue.get(message.guild.id);
if (!queue) return $return(`There isn\'t any music playing to change the volume of. Better queue some up!`);
if (!queue) return $return('There isn\'t any music playing to change the volume of. Better queue some up!');
if (!args[0]) return $return(`The dial is currently set to ${ queue.volume }.`);

@@ -160,0 +316,0 @@ if (!queue.voiceChannel.members.has(message.author.id)) {

@@ -23,130 +23,2 @@ 'use babel';

Function.prototype.$asyncbind = function anonymous(self, catcher) {
var resolver = this;
if (catcher === true) {
if (!Function.prototype.$asyncbind.EagerThenable) Function.prototype.$asyncbind.EagerThenable = function factory(tick) {
var _tasks = [];
if (!tick) {
try {
tick = process.nextTick;
} catch (ex) {
tick = function tick(p) {
setTimeout(p, 0);
};
}
}
function _untask() {
for (var i = 0; i < _tasks.length; i += 2) {
var t = _tasks[i + 1],
r = _tasks[i];
for (var j = 0; j < t.length; j++) t[j].call(null, r);
}
_tasks = [];
}
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === 'function';
}
function EagerThenable(resolver) {
function done(inline) {
var w;
if (_sync || phase < 0 || (w = _thens[phase]).length === 0) return;
_tasks.push(result, w);
_thens = [[], []];
if (_tasks.length === 2) inline ? _untask() : tick(_untask);
}
function resolveThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 0;
result = x;
done(true);
}
function rejectThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 1;
result = x;
done(true);
}
function settler(resolver, rejecter) {
_thens[0].push(resolver);
_thens[1].push(rejecter);
done();
}
function toString() {
return 'EagerThenable{' + {
'-1': 'pending',
0: 'resolved',
1: 'rejected'
}[phase] + '}=' + result.toString();
}
function guard() {
try {
resolver.call(null, resolveThen, rejectThen);
} catch (ex) {
rejectThen(ex);
}
}
this.then = settler;
this.toString = toString;
var _thens = [[], []],
_sync = true,
phase = -1,
result;
guard();
_sync = false;
done();
}
EagerThenable.resolve = function (v) {
return isThenable(v) ? v : {
then: function then(resolve, reject) {
return resolve(v);
}
};
};
return EagerThenable;
}();
return new Function.prototype.$asyncbind.EagerThenable(boundThen);
}
if (catcher) {
if (Function.prototype.$asyncbind.wrapAsyncStack) catcher = Function.prototype.$asyncbind.wrapAsyncStack(catcher);
return then;
}
function then(result, error) {
try {
return result && result instanceof Object && typeof result.then === 'function' ? result.then(then, catcher) : resolver.call(self, result, error || catcher);
} catch (ex) {
return (error || catcher)(ex);
}
}
function boundThen(result, error) {
return resolver.call(self, result, error);
}
boundThen.then = boundThen;
return boundThen;
};
_bot2.default.config.defaults.log = 'moosik.log';

@@ -153,0 +25,0 @@ _bot2.default.config.defaults.storage = 'moosik-storage';

@@ -69,128 +69,284 @@ #!/usr/bin/env node

Function.prototype.$asyncbind = function anonymous(self, catcher) {
var resolver = this;
Function.prototype.$asyncbind = function $asyncbind(self, catcher) {
"use strict";
if (catcher === true) {
if (!Function.prototype.$asyncbind.EagerThenable) Function.prototype.$asyncbind.EagerThenable = function factory(tick) {
var _tasks = [];
if (!Function.prototype.$asyncbind) {
Object.defineProperty(Function.prototype, "$asyncbind", {
value: $asyncbind,
enumerable: false,
configurable: true,
writable: true
});
}
if (!tick) {
if (!$asyncbind.trampoline) {
$asyncbind.trampoline = function trampoline(t, x, s, e, u) {
return function b(q) {
while (q) {
if (q.then) {
q = q.then(b, e);
return u ? undefined : q;
}
try {
if (q.pop) {
if (q.length) return q.pop() ? x.call(t) : q;
q = s;
} else q = q.call(t);
} catch (r) {
return e(r);
}
}
};
};
}
if (!$asyncbind.LazyThenable) {
$asyncbind.LazyThenable = function () {
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === "function";
}
function resolution(p, r, how) {
try {
tick = process.nextTick;
var x = how ? how(r) : r;
if (p === x) return p.reject(new TypeError("Promise resolution loop"));
if (isThenable(x)) {
x.then(function (y) {
resolution(p, y);
}, function (e) {
p.reject(e);
});
} else {
p.resolve(x);
}
} catch (ex) {
tick = function tick(p) {
setTimeout(p, 0);
};
p.reject(ex);
}
}
function _untask() {
for (var i = 0; i < _tasks.length; i += 2) {
var t = _tasks[i + 1],
r = _tasks[i];
function Chained() {}
for (var j = 0; j < t.length; j++) t[j].call(null, r);
;
Chained.prototype = {
resolve: _unchained,
reject: _unchained,
then: thenChain
};
function _unchained(v) {}
function thenChain(res, rej) {
this.resolve = res;
this.reject = rej;
}
function then(res, rej) {
var chain = new Chained();
try {
this._resolver(function (value) {
return isThenable(value) ? value.then(res, rej) : resolution(chain, value, res);
}, function (ex) {
resolution(chain, ex, rej);
});
} catch (ex) {
resolution(chain, ex, rej);
}
_tasks = [];
return chain;
}
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === 'function';
function Thenable(resolver) {
this._resolver = resolver;
this.then = then;
}
function EagerThenable(resolver) {
function done(inline) {
var w;
if (_sync || phase < 0 || (w = _thens[phase]).length === 0) return;
;
_tasks.push(result, w);
Thenable.resolve = function (v) {
return Thenable.isThenable(v) ? v : {
then: function then(resolve) {
return resolve(v);
}
};
};
_thens = [[], []];
if (_tasks.length === 2) inline ? _untask() : tick(_untask);
}
Thenable.isThenable = isThenable;
return Thenable;
}();
function resolveThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 0;
result = x;
done(true);
$asyncbind.EagerThenable = $asyncbind.Thenable = ($asyncbind.EagerThenableFactory = function (tick) {
tick = tick || typeof process === "object" && process.nextTick || typeof setImmediate === "function" && setImmediate || function (f) {
setTimeout(f, 0);
};
var soon = function () {
var fq = [],
fqStart = 0,
bufferSize = 1024;
function callQueue() {
while (fq.length - fqStart) {
fq[fqStart]();
fq[fqStart++] = undefined;
if (fqStart === bufferSize) {
fq.splice(0, bufferSize);
fqStart = 0;
}
}
}
function rejectThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 1;
result = x;
done(true);
return function (fn) {
fq.push(fn);
if (fq.length - fqStart === 1) tick(callQueue);
};
}();
function Zousan(func) {
if (func) {
var me = this;
func(function (arg) {
me.resolve(arg);
}, function (arg) {
me.reject(arg);
});
}
}
function settler(resolver, rejecter) {
_thens[0].push(resolver);
Zousan.prototype = {
resolve: function resolve(value) {
if (this.state !== undefined) return;
if (value === this) return this.reject(new TypeError("Attempt to resolve promise with self"));
var me = this;
_thens[1].push(rejecter);
if (value && (typeof value === "function" || typeof value === "object")) {
try {
var first = 0;
var then = value.then;
done();
}
if (typeof then === "function") {
then.call(value, function (ra) {
if (!first++) {
me.resolve(ra);
}
}, function (rr) {
if (!first++) {
me.reject(rr);
}
});
return;
}
} catch (e) {
if (!first) this.reject(e);
return;
}
}
function toString() {
return 'EagerThenable{' + {
'-1': 'pending',
0: 'resolved',
1: 'rejected'
}[phase] + '}=' + result.toString();
this.state = STATE_FULFILLED;
this.v = value;
if (me.c) soon(function () {
for (var n = 0, l = me.c.length; n < l; n++) STATE_FULFILLED(me.c[n], value);
});
},
reject: function reject(reason) {
if (this.state !== undefined) return;
this.state = STATE_REJECTED;
this.v = reason;
var clients = this.c;
if (clients) soon(function () {
for (var n = 0, l = clients.length; n < l; n++) STATE_REJECTED(clients[n], reason);
});
},
then: function then(onF, onR) {
var p = new Zousan();
var client = {
y: onF,
n: onR,
p: p
};
if (this.state === undefined) {
if (this.c) this.c.push(client);else this.c = [client];
} else {
var s = this.state,
a = this.v;
soon(function () {
s(client, a);
});
}
return p;
}
};
function guard() {
function STATE_FULFILLED(c, arg) {
if (typeof c.y === "function") {
try {
resolver.call(null, resolveThen, rejectThen);
} catch (ex) {
rejectThen(ex);
var yret = c.y.call(undefined, arg);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
}
} else c.p.resolve(arg);
}
this.then = settler;
this.toString = toString;
var _thens = [[], []],
_sync = true,
phase = -1,
result;
guard();
_sync = false;
done();
function STATE_REJECTED(c, reason) {
if (typeof c.n === "function") {
try {
var yret = c.n.call(undefined, reason);
c.p.resolve(yret);
} catch (err) {
c.p.reject(err);
}
} else c.p.reject(reason);
}
EagerThenable.resolve = function (v) {
return isThenable(v) ? v : {
then: function then(resolve, reject) {
return resolve(v);
}
};
Zousan.resolve = function (val) {
if (val && val instanceof Zousan) return val;
var z = new Zousan();
z.resolve(val);
return z;
};
return EagerThenable;
}();
return new Function.prototype.$asyncbind.EagerThenable(boundThen);
}
Zousan.reject = function (err) {
if (err && err instanceof Zousan) return err;
var z = new Zousan();
z.reject(err);
return z;
};
if (catcher) {
if (Function.prototype.$asyncbind.wrapAsyncStack) catcher = Function.prototype.$asyncbind.wrapAsyncStack(catcher);
return then;
Zousan.version = "2.3.2-nodent";
return Zousan;
})();
}
function then(result, error) {
try {
return result && result instanceof Object && typeof result.then === 'function' ? result.then(then, catcher) : resolver.call(self, result, error || catcher);
} catch (ex) {
return (error || catcher)(ex);
}
var resolver = this;
switch (catcher) {
case true:
return new $asyncbind.Thenable(boundThen);
case 0:
return new $asyncbind.LazyThenable(boundThen);
case undefined:
boundThen.then = boundThen;
return boundThen;
default:
return function () {
try {
return resolver.apply(self, arguments);
} catch (ex) {
return catcher(ex);
}
};
}
function boundThen(result, error) {
return resolver.call(self, result, error);
function boundThen() {
return resolver.apply(self, arguments);
}
boundThen.then = boundThen;
return boundThen;
};

@@ -208,25 +364,22 @@

let interruptCount = 0;
process.on('SIGINT', () => {
return new Promise(function ($return, $error) {
interruptCount++;
process.on('SIGINT', () => new Promise(function ($return, $error) {
interruptCount++;
if (interruptCount === 1) {
_bot2.default.logger.info('Received interrupt signal; destroying client and exiting...');
return Promise.all([client.destroy()]).catch(err => {
_bot2.default.logger.error(err);
}).then(function ($await_2) {
process.exit(0);
return $If_1.call(this);
}.$asyncbind(this, $error), $error);
} else {
_bot2.default.logger.info('Received another interrupt signal; immediately exiting.');
process.exit(0);
return $If_1.call(this);
}
function $IfStatement_1() {
return $return();
}
if (interruptCount === 1) {
_bot2.default.logger.info('Received interrupt signal; destroying client and exiting...');
return Promise.all([client.destroy()]).catch(err => {
_bot2.default.logger.error(err);
}).then(function ($await_2) {
process.exit(0);
return $IfStatement_1.call(this);
}.$asyncbind(this, $error), $error);
} else {
_bot2.default.logger.info('Received another interrupt signal; immediately exiting.');
process.exit(0);
return $IfStatement_1.call(this);
}
}.$asyncbind(undefined));
});
function $If_1() {
return $return();
}
}.$asyncbind(this)));
//# sourceMappingURL=moosik.js.map

@@ -12,130 +12,2 @@ 'use babel';

Function.prototype.$asyncbind = function anonymous(self, catcher) {
var resolver = this;
if (catcher === true) {
if (!Function.prototype.$asyncbind.EagerThenable) Function.prototype.$asyncbind.EagerThenable = function factory(tick) {
var _tasks = [];
if (!tick) {
try {
tick = process.nextTick;
} catch (ex) {
tick = function tick(p) {
setTimeout(p, 0);
};
}
}
function _untask() {
for (var i = 0; i < _tasks.length; i += 2) {
var t = _tasks[i + 1],
r = _tasks[i];
for (var j = 0; j < t.length; j++) t[j].call(null, r);
}
_tasks = [];
}
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === 'function';
}
function EagerThenable(resolver) {
function done(inline) {
var w;
if (_sync || phase < 0 || (w = _thens[phase]).length === 0) return;
_tasks.push(result, w);
_thens = [[], []];
if (_tasks.length === 2) inline ? _untask() : tick(_untask);
}
function resolveThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 0;
result = x;
done(true);
}
function rejectThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 1;
result = x;
done(true);
}
function settler(resolver, rejecter) {
_thens[0].push(resolver);
_thens[1].push(rejecter);
done();
}
function toString() {
return 'EagerThenable{' + {
'-1': 'pending',
0: 'resolved',
1: 'rejected'
}[phase] + '}=' + result.toString();
}
function guard() {
try {
resolver.call(null, resolveThen, rejectThen);
} catch (ex) {
rejectThen(ex);
}
}
this.then = settler;
this.toString = toString;
var _thens = [[], []],
_sync = true,
phase = -1,
result;
guard();
_sync = false;
done();
}
EagerThenable.resolve = function (v) {
return isThenable(v) ? v : {
then: function then(resolve, reject) {
return resolve(v);
}
};
};
return EagerThenable;
}();
return new Function.prototype.$asyncbind.EagerThenable(boundThen);
}
if (catcher) {
if (Function.prototype.$asyncbind.wrapAsyncStack) catcher = Function.prototype.$asyncbind.wrapAsyncStack(catcher);
return then;
}
function then(result, error) {
try {
return result && result instanceof Object && typeof result.then === 'function' ? result.then(then, catcher) : resolver.call(self, result, error || catcher);
} catch (ex) {
return (error || catcher)(ex);
}
}
function boundThen(result, error) {
return resolver.call(self, result, error);
}
boundThen.then = boundThen;
return boundThen;
};
class Song {

@@ -142,0 +14,0 @@ constructor(video, member) {

@@ -13,132 +13,4 @@ 'use babel';

Function.prototype.$asyncbind = function anonymous(self, catcher) {
var resolver = this;
if (catcher === true) {
if (!Function.prototype.$asyncbind.EagerThenable) Function.prototype.$asyncbind.EagerThenable = function factory(tick) {
var _tasks = [];
if (!tick) {
try {
tick = process.nextTick;
} catch (ex) {
tick = function tick(p) {
setTimeout(p, 0);
};
}
}
function _untask() {
for (var i = 0; i < _tasks.length; i += 2) {
var t = _tasks[i + 1],
r = _tasks[i];
for (var j = 0; j < t.length; j++) t[j].call(null, r);
}
_tasks = [];
}
function isThenable(obj) {
return obj && obj instanceof Object && typeof obj.then === 'function';
}
function EagerThenable(resolver) {
function done(inline) {
var w;
if (_sync || phase < 0 || (w = _thens[phase]).length === 0) return;
_tasks.push(result, w);
_thens = [[], []];
if (_tasks.length === 2) inline ? _untask() : tick(_untask);
}
function resolveThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 0;
result = x;
done(true);
}
function rejectThen(x) {
if (phase >= 0) return;
if (isThenable(x)) return x.then(resolveThen, rejectThen);
phase = 1;
result = x;
done(true);
}
function settler(resolver, rejecter) {
_thens[0].push(resolver);
_thens[1].push(rejecter);
done();
}
function toString() {
return 'EagerThenable{' + {
'-1': 'pending',
0: 'resolved',
1: 'rejected'
}[phase] + '}=' + result.toString();
}
function guard() {
try {
resolver.call(null, resolveThen, rejectThen);
} catch (ex) {
rejectThen(ex);
}
}
this.then = settler;
this.toString = toString;
var _thens = [[], []],
_sync = true,
phase = -1,
result;
guard();
_sync = false;
done();
}
EagerThenable.resolve = function (v) {
return isThenable(v) ? v : {
then: function then(resolve, reject) {
return resolve(v);
}
};
};
return EagerThenable;
}();
return new Function.prototype.$asyncbind.EagerThenable(boundThen);
}
if (catcher) {
if (Function.prototype.$asyncbind.wrapAsyncStack) catcher = Function.prototype.$asyncbind.wrapAsyncStack(catcher);
return then;
}
function then(result, error) {
try {
return result && result instanceof Object && typeof result.then === 'function' ? result.then(then, catcher) : resolver.call(self, result, error || catcher);
} catch (ex) {
return (error || catcher)(ex);
}
}
function boundThen(result, error) {
return resolver.call(self, result, error);
}
boundThen.then = boundThen;
return boundThen;
};
const version = exports.version = JSON.parse((0, _fs.readFileSync)((0, _path.join)(__dirname, '../package.json'))).version;
exports.default = version;
//# sourceMappingURL=version.js.map
{
"name": "discord-moosik",
"version": "0.5.5",
"version": "0.5.6",
"description": "A Discord bot that does some music stuff",

@@ -27,3 +27,3 @@ "license": "MIT",

"dependencies": {
"discord-graf": "^0.14.0",
"discord-graf": "^0.15.0",
"yargs": "^5.0.0",

@@ -30,0 +30,0 @@ "common-tags": "^1.3.0",

@@ -20,3 +20,3 @@ 'use babel';

const queue = this.queue.get(message.guild.id);
if(!queue) return `There isn\'t any music playing to pause, oh brilliant one.`;
if(!queue) return 'There isn\'t any music playing to pause, oh brilliant one.';
if(!queue.songs[0].dispatcher) return 'It\'s kind of tough to pause a song that hasn\'t even begun playing yet.';

@@ -23,0 +23,0 @@ if(!queue.songs[0].playing) return 'Pausing a song that is already paused is a bad move. I wouldn\'t recommend it.';

@@ -19,3 +19,3 @@ 'use babel';

const queue = this.queue.get(message.guild.id);
if(!queue) return `There isn\'t any music playing to resume, oh brilliant one.`;
if(!queue) return 'There isn\'t any music playing to resume, oh brilliant one.';
if(!queue.songs[0].dispatcher) {

@@ -22,0 +22,0 @@ return 'Pretty sure a song that hasn\'t actually begun playing yet could be considered "resumed".';

@@ -23,3 +23,3 @@ 'use babel';

const queue = this.queue.get(message.guild.id);
if(!queue) return `There isn\'t any music playing to change the volume of. Better queue some up!`;
if(!queue) return 'There isn\'t any music playing to change the volume of. Better queue some up!';
if(!args[0]) return `The dial is currently set to ${queue.volume}.`;

@@ -26,0 +26,0 @@ if(!queue.voiceChannel.members.has(message.author.id)) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc