Skip to content

Commit

Permalink
fix(network): send to only connected networks
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-737 committed Aug 31, 2023
1 parent c3ea336 commit b01b415
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Events/messageCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export default {

const db = getDb();
const channelInDb = await db.connectedList.findFirst({
where: { channelId: message.channel.id },
include: { hub: { include: { connections: true } } },
where: { channelId: message.channel.id, connected: true },
include: { hub: { include: { connections: { where: { connected: true } } } } },
});

if (channelInDb?.connected && channelInDb.hub) {
if (channelInDb && channelInDb?.hub) {
if (!await checks.execute(message, channelInDb)) return;

message.censored_content = censor(message.content);
Expand Down

0 comments on commit b01b415

Please sign in to comment.