aboutsummaryrefslogtreecommitdiff
path: root/src/utils/discord.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/discord.ts')
-rw-r--r--src/utils/discord.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/utils/discord.ts b/src/utils/discord.ts
index f1a1f8a..ec732b4 100644
--- a/src/utils/discord.ts
+++ b/src/utils/discord.ts
@@ -16,9 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+import { findLazy } from "@webpack";
import { ChannelStore, GuildStore, PrivateChannelsStore, SelectedChannelStore } from "@webpack/common";
import { Guild } from "discord-types/general";
+const PreloadedUserSettings = findLazy(m => m.ProtoClass?.typeName.endsWith("PreloadedUserSettings"));
+
export function getCurrentChannel() {
return ChannelStore.getChannel(SelectedChannelStore.getChannelId());
}
@@ -30,3 +33,12 @@ export function getCurrentGuild(): Guild | undefined {
export function openPrivateChannel(userId: string) {
PrivateChannelsStore.openPrivateChannel(userId);
}
+
+export const enum Theme {
+ Dark = 1,
+ Light = 2
+}
+
+export function getTheme(): Theme {
+ return PreloadedUserSettings.getCurrentValue()?.appearance?.theme;
+}