decord/source/modules/messages/MessageUtils.tsx

33 lines
1 KiB
TypeScript
Raw Normal View History

// Module ID: 10174
// Function ID: 10175
// Name: MessageUtils
// Dependencies: [1957, 1371, 4817, 2]
2026-07-20 16:05:17 +00:00
// Exports: canViewPotentiallyNSFWChannel, getGuildIdFromMessage
// Module 10174 (MessageUtils)
import AgeGateUtils from "AgeGateUtils" /* 4817 */;
import ChannelStore from "ChannelStore" /* 1957 */;
import UserStore from "UserStore" /* 1371 */;
2026-07-23 10:11:24 +00:00
require = fn;
const size = fn(2);
const result = size.fileFinishedImporting("modules/messages/MessageUtils.tsx");
2026-07-20 16:05:17 +00:00
export const canViewPotentiallyNSFWChannel = function canViewPotentiallyNSFWChannel(channel_id) {
const currentUser = UserStore.getCurrentUser();
const channel = ChannelStore.getChannel(channel_id);
2026-07-20 16:05:17 +00:00
let tmp3 = null != currentUser && null != channel;
if (tmp3) {
tmp3 = !AgeGateUtils.isChannelContentGated(channel);
2026-07-20 16:05:17 +00:00
}
return tmp3;
};
export const getGuildIdFromMessage = function getGuildIdFromMessage(channel_id) {
const channel = ChannelStore.getChannel(channel_id.channel_id);
2026-07-20 16:05:17 +00:00
let guild_id;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
guild_id = channel.guild_id;
}
2026-07-29 08:29:29 +00:00
return guild_id;
2026-07-20 16:05:17 +00:00
};