mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 14:13:02 -04:00
exports
This commit is contained in:
parent
e2146f5716
commit
6484c69851
4 changed files with 8 additions and 27 deletions
|
@ -19,7 +19,7 @@ const cluster = new ClusterClient("", {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Create this clusters paginator
|
// Create this clusters paginator
|
||||||
const paginator = new Paginator(cluster, {
|
module.exports.paginator = new Paginator(cluster, {
|
||||||
maxTime: 300000,
|
maxTime: 300000,
|
||||||
pageLoop: true,
|
pageLoop: true,
|
||||||
pageNumber: true
|
pageNumber: true
|
||||||
|
@ -47,7 +47,3 @@ if(process.env.PREFIX_OVERRIDE) commandPrefix = process.env.PREFIX_OVERRIDE;
|
||||||
await interactionClient.run();
|
await interactionClient.run();
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
paginator
|
|
||||||
}
|
|
|
@ -22,12 +22,8 @@ const ALIASES = {
|
||||||
"rs": "reset"
|
"rs": "reset"
|
||||||
}
|
}
|
||||||
|
|
||||||
function format(text, color){
|
module.exports.format = function(text, color){
|
||||||
if(!ANSI_COLORS[color] && !ALIASES[color]) throw "Invalid ANSI Color"
|
if(!ANSI_COLORS[color] && !ALIASES[color]) throw "Invalid ANSI Color"
|
||||||
if(!ANSI_COLORS[color]) color = ALIASES[color]
|
if(!ANSI_COLORS[color]) color = ALIASES[color]
|
||||||
return `${ANSI_COLORS[color]}${text}${ANSI_COLORS.reset}`
|
return `${ANSI_COLORS[color]}${text}${ANSI_COLORS.reset}`
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
format
|
|
||||||
}
|
|
|
@ -46,7 +46,7 @@ async function getRecentMedia(context, limit) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async function getRecentVideo(context, limit) {
|
module.exports.getRecentVideo = async function(context, limit) {
|
||||||
if (!context.message.channel) {
|
if (!context.message.channel) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ async function getRecentVideo(context, limit) {
|
||||||
return attachments;
|
return attachments;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getRecentImage(context, limit) {
|
module.exports.getRecentImage= async function(context, limit){
|
||||||
let attachments = await getRecentMedia(context, limit)
|
let attachments = await getRecentMedia(context, limit)
|
||||||
let at;
|
let at;
|
||||||
let validImages = attachmentTypes.image
|
let validImages = attachmentTypes.image
|
||||||
|
@ -94,8 +94,3 @@ async function getRecentImage(context, limit) {
|
||||||
}
|
}
|
||||||
return at;
|
return at;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
getRecentImage,
|
|
||||||
getRecentVideo
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
async function getUser(context, query){
|
module.exports.getUser = async function(context, query){
|
||||||
let user;
|
let user;
|
||||||
let member;
|
let member;
|
||||||
if(/[0-9]{17,18}/.test(query)){
|
if(/[0-9]{17,18}/.test(query)){
|
||||||
|
@ -16,7 +16,7 @@ async function getUser(context, query){
|
||||||
return {user: user, member: member};
|
return {user: user, member: member};
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getMember(context, query){
|
module.exports.getMember = async function(context, query){
|
||||||
if(!context.guild) return;
|
if(!context.guild) return;
|
||||||
if(/[0-9]{17,18}/.test(query)){
|
if(/[0-9]{17,18}/.test(query)){
|
||||||
let uid = query.match(/[0-9]{17,18}/)
|
let uid = query.match(/[0-9]{17,18}/)
|
||||||
|
@ -50,16 +50,10 @@ const BADGES = Object.freeze({
|
||||||
[UserFlags.PREMIUM_EARLY_SUPPORTER]: '<:badge_earlysupporter:903277590956101672>'
|
[UserFlags.PREMIUM_EARLY_SUPPORTER]: '<:badge_earlysupporter:903277590956101672>'
|
||||||
})
|
})
|
||||||
|
|
||||||
function renderBadges(user){
|
module.exports.renderBadges = function(user){
|
||||||
let badges = [];
|
let badges = [];
|
||||||
for(const flag of Object.keys(BADGES)){
|
for(const flag of Object.keys(BADGES)){
|
||||||
if(user.hasFlag(parseInt(flag))) badges.push(BADGES[flag])
|
if(user.hasFlag(parseInt(flag))) badges.push(BADGES[flag])
|
||||||
}
|
}
|
||||||
return badges;
|
return badges;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
getUser,
|
|
||||||
getMember,
|
|
||||||
renderBadges
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue