Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.
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
10 changes: 6 additions & 4 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ type HubRating {
rating Int @default(0)
}

enum HubModeratorPosition {
network_mod
manager
}

type HubModerator {
userId String
position String @default("network_mod") // network, manager
// network -> just basic actions like warning/muting
// manager -> perm blacklisting, managing hub etc.
// honestly... I might as well make permissions lol
position HubModeratorPosition @default(network_mod)
}

type HubLogChannels {
Expand Down
24 changes: 12 additions & 12 deletions src/RandomComponents.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/* eslint-disable complexity */
import { RegisterInteractionHandler } from '#main/decorators/Interaction.js';
import HubSettingsManager from '#main/modules/HubSettingsManager.js';
import { InfoEmbed } from '#main/utils/EmbedUtils.js';
import { addReaction, removeReaction, updateReactions } from '#main/utils/reaction/actions.js';
import { checkBlacklists } from '#main/utils/reaction/helpers.js';
import sortReactions from '#main/utils/reaction/sortReactions.js';
import { stripIndents } from 'common-tags';
import {
ActionRowBuilder,
Expand All @@ -18,9 +21,7 @@ import { fetchConnection, updateConnection } from './utils/ConnectedListUtils.js
import { CustomID } from './utils/CustomID.js';
import db from './utils/Db.js';
import { t } from './utils/Locale.js';
import { getEmojiId, simpleEmbed, sortReactions } from './utils/Utils.js';
import HubSettingsManager from '#main/modules/HubSettingsManager.js';
import { InfoEmbed } from '#main/utils/EmbedUtils.js';
import { getEmojiId } from './utils/Utils.js';

export class RandomComponents {
/** Listens for a reaction button or select menu interaction and updates the reactions accordingly. */
Expand Down Expand Up @@ -98,7 +99,7 @@ export class RandomComponents {
.setPlaceholder('Add a reaction'),
);

const { hub } = networkMessage?.originalMsg;
const { hub } = networkMessage.originalMsg;
const hubSettings = new HubSettingsManager(hub.id, hub.settings);
if (!hubSettings.getSetting('Reactions')) reactionMenu.components[0].setDisabled(true);

Expand Down Expand Up @@ -214,13 +215,12 @@ export class RandomComponents {

await updateConnection({ channelId }, { connected: true });

await interaction.update({
embeds: [
simpleEmbed(
`### ${emojis.tick} Connection Resumed\nConnection has been resumed. Have fun chatting!`,
),
],
components: [],
});
const embed = new InfoEmbed()
.removeTitle()
.setDescription(
`### ${emojis.tick} Connection Resumed\nConnection has been resumed. Have fun chatting!`,
);

await interaction.update({ embeds: [embed], components: [] });
}
}
Loading