This commit is contained in:
derpystuff 2022-06-19 14:14:34 +02:00
parent e2146f5716
commit 6484c69851
4 changed files with 8 additions and 27 deletions

View file

@ -19,7 +19,7 @@ const cluster = new ClusterClient("", {
});
// Create this clusters paginator
const paginator = new Paginator(cluster, {
module.exports.paginator = new Paginator(cluster, {
maxTime: 300000,
pageLoop: true,
pageNumber: true
@ -47,7 +47,3 @@ if(process.env.PREFIX_OVERRIDE) commandPrefix = process.env.PREFIX_OVERRIDE;
await interactionClient.run();
})();
module.exports = {
paginator
}

View file

@ -22,12 +22,8 @@ const ALIASES = {
"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]) color = ALIASES[color]
return `${ANSI_COLORS[color]}${text}${ANSI_COLORS.reset}`
}
module.exports = {
format
}

View file

@ -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) {
return undefined;
}
@ -81,7 +81,7 @@ async function getRecentVideo(context, limit) {
return attachments;
}
async function getRecentImage(context, limit) {
module.exports.getRecentImage= async function(context, limit){
let attachments = await getRecentMedia(context, limit)
let at;
let validImages = attachmentTypes.image
@ -94,8 +94,3 @@ async function getRecentImage(context, limit) {
}
return at;
}
module.exports = {
getRecentImage,
getRecentVideo
}

View file

@ -1,4 +1,4 @@
async function getUser(context, query){
module.exports.getUser = async function(context, query){
let user;
let member;
if(/[0-9]{17,18}/.test(query)){
@ -16,7 +16,7 @@ async function getUser(context, query){
return {user: user, member: member};
}
async function getMember(context, query){
module.exports.getMember = async function(context, query){
if(!context.guild) return;
if(/[0-9]{17,18}/.test(query)){
let uid = query.match(/[0-9]{17,18}/)
@ -50,16 +50,10 @@ const BADGES = Object.freeze({
[UserFlags.PREMIUM_EARLY_SUPPORTER]: '<:badge_earlysupporter:903277590956101672>'
})
function renderBadges(user){
module.exports.renderBadges = function(user){
let badges = [];
for(const flag of Object.keys(BADGES)){
if(user.hasFlag(parseInt(flag))) badges.push(BADGES[flag])
}
return badges;
}
module.exports = {
getUser,
getMember,
renderBadges
}