aboutsummaryrefslogtreecommitdiff
path: root/src/utils/discord.ts
blob: 53206bbf4598db5d2afac7e38fe9758abebc71e9 (plain)
1
2
3
4
5
6
7
8
9
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);
}