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.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils/discord.ts b/src/utils/discord.ts
new file mode 100644
index 0000000..53206bb
--- /dev/null
+++ b/src/utils/discord.ts
@@ -0,0 +1,10 @@
+import { Guild } from "discord-types/general";
+import { ChannelStore, SelectedChannelStore, GuildStore } from "../webpack/common";
+
+export function getCurrentChannel() {
+ return ChannelStore.getChannel(SelectedChannelStore.getChannelId());
+}
+
+export function getCurrentGuild(): Guild | undefined {
+ return GuildStore.getGuild(getCurrentChannel()?.guild_id);
+}