decord/alpha/source/modules/messages/MessageUtils.tsx
github-actions 52331fb8ae chore: update source for alpha 349.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5051.js (118.4 MB)
2026-09-30 07:29:52 +00:00

32 lines
1 KiB
TypeScript

// Module ID: 9745
// Function ID: 9746
// Name: MessageUtils
// Dependencies: [2045, 1372, 5076, 2]
// Exports: canViewPotentiallyNSFWChannel, getGuildIdFromMessage
// Module 9745 (MessageUtils)
import AgeGateUtils from "AgeGateUtils" /* 5076 */;
import ChannelStore from "ChannelStore" /* 2045 */;
import UserStore from "UserStore" /* 1372 */;
require = fn;
const size = fn(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) {
tmp3 = !AgeGateUtils.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;
};