This commit is contained in:
Skylar Grant 2024-09-26 09:55:49 -04:00
parent ed315d0cb1
commit 2cbfc7f354

View File

@ -16,6 +16,17 @@ module.exports = {
if (this.args.startsWith('http')) return false; if (this.args.startsWith('http')) return false;
if (this.args.startsWith('www')) return false; if (this.args.startsWith('www')) return false;
// Check for and extract the part of the message that's
// wrapped in any type of brackets or quotes eg. ([{``''""}])
const bracketStart = this.args.match(/[\[\(\{\`\'\"\`]/g);
const bracketEnd = this.args.match(/[\]\)\}\`\'\"\`]/g);
let bracketedText = new String();
if ((bracketStart && bracketEnd) && (bracketStart.length !== bracketEnd.length)) {
bracketedText = this.args.slice(this.args.indexOf(bracketStart[0]), this.args.lastIndexOf(bracketEnd[0]) + 1);
this.args = this.args.replace(bracketedText, '');
}
console.log(bracketedText);
for (const [key, value] of dotCommands) { for (const [key, value] of dotCommands) {
if (key === this.command) { if (key === this.command) {
this.isValid = true; this.isValid = true;