Skip to content
This repository was archived by the owner on Oct 10, 2024. It is now read-only.

Commit 055acb3

Browse files
authored
fix: github.blog to allowed links & cleanup testing errors (#823)
* feat: add github.blog to allowed links * fix: handle no admin channel * fix: remove deprecated version
1 parent 1e4fcac commit 055acb3

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

mongo-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# docker compose -f mongo-compose.yml up
2-
version: "1.0"
32
services:
43
mongodb:
54
image: mongo:6.0

src/events/onMessage.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ export const onMessage = async (bot: ExtendedClient, message: Message) => {
2020
const adminChannel = bot.channels.cache.get(
2121
process.env.ADMIN_CHANNEL!,
2222
) as TextChannel;
23-
await adminChannel.send({
24-
embeds: [linkMessage],
25-
});
23+
if (adminChannel) {
24+
await adminChannel.send({
25+
embeds: [linkMessage],
26+
});
27+
}
2628
return; // Return as message is deleted
2729
}
2830

src/links/checkLinks.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ import type { ExtendedClient } from '../interfaces/ExtendedClient.js';
44
import { errorHandler } from '../utils/errorHandler.js';
55
import { urlPattern } from '../config/UrlRegex.js';
66

7-
const allowedLinks = ['github.com', 'eddiejaoude.io', 'gitlab.com'];
7+
const allowedLinks = [
8+
'github.com',
9+
'eddiejaoude.io',
10+
'gitlab.com',
11+
'github.blog',
12+
];
813

914
export const checkLinks = async (
1015
bot: ExtendedClient,

0 commit comments

Comments
 (0)