This commit is contained in:
Isaac
2021-05-22 00:04:18 +01:00
parent 777719d1b3
commit 32f43ac18f
58 changed files with 837 additions and 926 deletions

View File

@@ -4,9 +4,9 @@ let current_presence = -1;
module.exports = {
/**
*
* @param {string} text
* @param {string} [additional]
*
* @param {string} text
* @param {string} [additional]
* @returns {string}
*/
footer: (text, additional) => {
@@ -20,16 +20,17 @@ module.exports = {
selectPresence: () => {
const length = config.presence.presences.length;
if (length === 0) return {};
let num;
if (length === 1)
if (length === 1) {
num = 0;
else if (config.presence.randomise)
} else if (config.presence.randomise) {
num = Math.floor(Math.random() * length);
else {
} else {
current_presence = current_presence + 1; // ++ doesn't work on negative numbers
if (current_presence === length)
if (current_presence === length) {
current_presence = 0;
}
num = current_presence;
}
@@ -48,5 +49,5 @@ module.exports = {
},
status
};
},
}
};

View File

@@ -25,7 +25,7 @@ module.exports = {
W: '🇼',
X: '🇽',
Y: '🇾',
Z: '🇿',
Z: '🇿'
},
numbers: {
0: '0⃣',
@@ -38,6 +38,6 @@ module.exports = {
7: '7⃣',
8: '8⃣',
9: '9⃣',
10: '🔟',
10: '🔟'
}
};

View File

@@ -6,5 +6,5 @@ module.exports = {
* @param {string} path - A path relative to the root of the project (like "./user/config.js")
* @returns {string} absolute path
*/
path: path => join(__dirname, '../../', path),
path: path => join(__dirname, '../../', path)
};

View File

@@ -1,10 +1,10 @@
module.exports = {
int2hex: (int) => int.toString(16).toUpperCase(),
int2hex: int => int.toString(16).toUpperCase(),
some: async (array, func) => {
for (const element of array) {
if (await func(element)) return true;
}
return false;
},
wait: (time) => new Promise(res => setTimeout(res, time)),
wait: time => new Promise(res => setTimeout(res, time))
};