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

Add github.blog to allowed links & cleanup testing errors #823

Merged
merged 3 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion mongo-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# docker compose -f mongo-compose.yml up
version: "1.0"
services:
mongodb:
image: mongo:6.0
Expand Down
8 changes: 5 additions & 3 deletions src/events/onMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ export const onMessage = async (bot: ExtendedClient, message: Message) => {
const adminChannel = bot.channels.cache.get(
process.env.ADMIN_CHANNEL!,
) as TextChannel;
await adminChannel.send({
embeds: [linkMessage],
});
if (adminChannel) {
await adminChannel.send({
embeds: [linkMessage],
});
}
return; // Return as message is deleted
}

Expand Down
7 changes: 6 additions & 1 deletion src/links/checkLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import type { ExtendedClient } from '../interfaces/ExtendedClient.js';
import { errorHandler } from '../utils/errorHandler.js';
import { urlPattern } from '../config/UrlRegex.js';

const allowedLinks = ['github.com', 'eddiejaoude.io', 'gitlab.com'];
const allowedLinks = [
'github.com',
'eddiejaoude.io',
'gitlab.com',
'github.blog',
];

export const checkLinks = async (
bot: ExtendedClient,
Expand Down