Vencord/src/utils/discord.ts

11 lines
366 B
TypeScript
Raw Normal View History

2022-10-09 13:48:42 -04:00
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);
}