Plugin

OverrideForumDefaults

Allows you to override default forum layout/sort order. you can still change it on a per-channel basis

Servers Organisation Customisation
index.tsx
Download

Source

src/plugins/overrideForumDefaults/index.tsx
1/*
2 * FiveCord — a Discord client mod
3 * Copyright (c) 2025 FiveCord
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
7import { definePluginSettings } from "@api/Settings";
8import { Devs } from "@utils/constants";
9import definePlugin, { OptionType } from "@utils/types";
10
11const settings = definePluginSettings({
12 defaultLayout: {
13 type: OptionType.SELECT,
14 options: [
15 { label: "List", value: 1, default: true },
16 { label: "Gallery", value: 2 }
17 ],
18 description: "Which layout to use as default"
19 },
20 defaultSortOrder: {
21 type: OptionType.SELECT,
22 options: [
23 { label: "Recently Active", value: 0, default: true },
24 { label: "Date Posted", value: 1 }
25 ],
26 description: "Which sort order to use as default"
27 }
28});
29
30export default definePlugin({
31 name: "OverrideForumDefaults",
32 description: "Allows you to override default forum layout/sort order. you can still change it on a per-channel basis",
33 tags: ["Servers", "Organisation", "Customisation"],
34 authors: [Devs.Inbestigator],
35 patches: [
36 {
37 find: "getDefaultLayout(){",
38 replacement: [
39 {
40 match: /}getDefaultLayout\(\){/,
41 replace: "$&return $self.getLayout();"
42 },
43 {
44 match: /}getDefaultSortOrder\(\){/,
45 replace: "$&return $self.getSortOrder();"
46 }
47 ]
48 }
49 ],
50
51 getLayout: () => settings.store.defaultLayout,
52 getSortOrder: () => settings.store.defaultSortOrder,
53
54 settings
55});
56