Skip to content

Commit

Permalink
chore: removed unused things
Browse files Browse the repository at this point in the history
  • Loading branch information
flowergardn committed Nov 1, 2023
1 parent 40a5d14 commit 4279d91
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 191 deletions.
9 changes: 0 additions & 9 deletions src/guards/PreventBots.ts

This file was deleted.

23 changes: 0 additions & 23 deletions src/guards/RequireGuildMember.ts

This file was deleted.

34 changes: 0 additions & 34 deletions src/guards/RequirePermission.ts

This file was deleted.

35 changes: 1 addition & 34 deletions src/lib/General.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { APIEmbed } from 'discord.js';

const prettify = (s: string, titleCase: boolean = false) => {
let newString = s.replace(/(_|-)/gi, ' ');
newString = newString.charAt(0).toUpperCase() + newString.slice(1);
Expand All @@ -11,35 +9,4 @@ const prettify = (s: string, titleCase: boolean = false) => {
.join(' ');
};

function replacePlaceholders(
s: string,
map: Map<string, string>,
characters: string = '%%'
): string {
let placeholded = s;

for (const [key, value] of map.entries()) {
const regex = new RegExp(`${characters[0]}${key}${characters[1]}`, 'g');
placeholded = placeholded.replace(regex, value);
}

return placeholded;
}

function parseEmbed(obj: APIEmbed, map: Map<string, string>): APIEmbed {
const result: APIEmbed = {};

for (const key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
if (key === 'color') {
result[key] = obj[key];
continue;
}
result[key] = replacePlaceholders(obj[key], map);
}
}

return result;
}

export { prettify, replacePlaceholders, parseEmbed };
export { prettify };
62 changes: 0 additions & 62 deletions src/lib/Punishments.ts

This file was deleted.

29 changes: 0 additions & 29 deletions src/lib/Time.ts

This file was deleted.

0 comments on commit 4279d91

Please sign in to comment.