Skip to content

Commit a385102

Browse files
committed
fix: appease the linter
1 parent d7d44ea commit a385102

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/events/on_message/_advise.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ChannelType, Message } from 'discord.js';
1+
import { ChannelType, type Message } from 'discord.js';
22
import { has_link } from './_common.js';
33
import urlRegex from 'url-regex';
44

@@ -46,22 +46,13 @@ export default async function mutate_content(message: Message) {
4646

4747
const updatedLinkList = updatedLinks.map((link) => `- ${link}\n`).join('');
4848

49-
const updatedMessage: string = (function () {
50-
let newContent = message.content;
51-
replacementMap.forEach(
52-
(item) =>
53-
(newContent = newContent.replace(item.test, item.replace)),
54-
);
55-
return newContent;
56-
})();
57-
5849
try {
5950
await message.author.send(
6051
`Re: ${message.url}\n\nI see you've provided a link to \`x.com\`. Please consider posting a new message having \`x.com\` replaced with \`xcancel.com\`, that way server members may view the message and thread without requiring an account.\n\n${updatedPhrase}\`\`\`${updatedLinkList}\`\`\`\n\nHere is your entire message with adjusted links:\n\`\`\`${updatedLinkList}\`\`\``,
6152
);
6253

6354
return; // mission complete
64-
} catch (e) {
55+
} catch (_) {
6556
// assume user disabled DMs upon error
6657
}
6758

@@ -70,7 +61,7 @@ export default async function mutate_content(message: Message) {
7061
await message.reply(
7162
`I converted your \`x.com\` links to use \`xcancel.com\` so that server members won't require an account to view content and threads.\n\n${updatedLinkList}`,
7263
);
73-
} catch (e) {
64+
} catch (_) {
7465
// don't handle failures
7566
}
7667
}

0 commit comments

Comments
 (0)