Skip to content

Commit 7df75de

Browse files
author
Manuel
committed
fix: append twitter url path to vxtwitter
1 parent b0767d8 commit 7df75de

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/handlers/handle-guild-message-creation.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import { MessageType } from 'discord.js';
33

44
const urlMappings = [
55
{
6-
pattern: /https?:\/\/(mobile\.)?twitter\.com\/\S+/g,
7-
replacement: 'https://vxtwitter.com',
6+
pattern: /https?:\/\/(mobile\.)?twitter\.com\/(\S+)/g,
7+
replacement: 'https://vxtwitter.com/$2',
88
},
99
];
10+
1011
export const handleGuildMessageCreation = async (message: Message) => {
1112
if (message.author.bot) {
1213
return;

0 commit comments

Comments
 (0)