Skip to content

Commit

Permalink
Update messageCreate.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hchoki authored Aug 14, 2024
1 parent f1405fa commit ba33122
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions events/messageCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ module.exports = (client, message) => {
message.reply(replyText);
}

// TikTok message logic
const linkRegexTikTok = /https?:\/\/(www\.)?tiktok\.com\/[^\s]+/g;
const foundLinksTikTok = message.content.match(linkRegexTikTok);

if (foundLinksTikTok) {
let replyText = '';
for (let link of foundLinksTikTok) {
link = link.replace('tiktok.com', 'vxtiktok.com');
replyText += `${link}\n`;
}
message.suppressEmbeds(true);
message.reply(replyText);
}

// Gumroad message logic
const linkRegexGumroad = /https?:\/\/[^\s.]+\.gumroad\.com\/l\/[^\s]+/g;
const foundLinksGumroad = message.content.match(linkRegexGumroad);
Expand Down

0 comments on commit ba33122

Please sign in to comment.