decord/beta/source/modules/messages/MessageUtils.tsx

33 lines
1.1 KiB
TypeScript
Raw Permalink Normal View History

2026-10-12 16:32:48 +00:00
// Module ID: 12569
// Function ID: 12570
// Name: MessageUtils
2026-10-12 16:32:48 +00:00
// Dependencies: [2065, 1390, 5924, 2]
// Exports: canViewPotentiallyNSFWChannel, getGuildIdFromMessage
2026-10-12 16:32:48 +00:00
// Module 12569 (MessageUtils)
import AgeGateUtils from "AgeGateUtils" /* 5924 */;
import ChannelStore from "ChannelStore" /* 2065 */;
import UserStore from "UserStore" /* 1390 */;
2026-10-01 14:13:23 +00:00
import size from "module_2" /* 2 */;
const result = size.fileFinishedImporting("modules/messages/MessageUtils.tsx");
export const canViewPotentiallyNSFWChannel = function canViewPotentiallyNSFWChannel(channel_id) {
const currentUser = UserStore.getCurrentUser();
const channel = ChannelStore.getChannel(channel_id);
let tmp3 = null != currentUser && null != channel;
if (tmp3) {
2026-10-01 14:13:23 +00:00
const obj = AgeGateUtils;
tmp3 = !obj.isChannelContentGated(channel);
}
return tmp3;
};
export const getGuildIdFromMessage = function getGuildIdFromMessage(channel_id) {
const channel = ChannelStore.getChannel(channel_id.channel_id);
let guild_id;
if (channel != null) {
guild_id = channel.guild_id;
}
return guild_id;
};