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

Commit

Permalink
fix: github.blog to allowed links & cleanup testing errors (#823)
Browse files Browse the repository at this point in the history
* feat: add github.blog to allowed links

* fix: handle no admin channel

* fix: remove deprecated version
  • Loading branch information
dan-mba authored Sep 26, 2024
1 parent 1e4fcac commit 055acb3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
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

0 comments on commit 055acb3

Please sign in to comment.