decord/source/modules/messages/MessageUtils.tsx

32 lines
1.1 KiB
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 9755
// Function ID: 9756
2026-07-20 16:05:17 +00:00
// Name: canViewPotentiallyNSFWChannel
2026-08-08 06:10:11 +00:00
// Dependencies: [1372, 1903, 4517, 2]
2026-07-20 16:05:17 +00:00
// Exports: canViewPotentiallyNSFWChannel, getGuildIdFromMessage
2026-08-08 06:10:11 +00:00
// Module 9755 (canViewPotentiallyNSFWChannel)
2026-07-29 08:29:29 +00:00
import ensureGuildLoaded from "ensureGuildLoaded";
import mergeGuildAvatar from "mergeGuildAvatar";
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
const result = require("shouldShowAgeGateForVoiceChannel").fileFinishedImporting("modules/messages/MessageUtils.tsx");
2026-07-20 16:05:17 +00:00
export const canViewPotentiallyNSFWChannel = function canViewPotentiallyNSFWChannel(channel_id) {
2026-07-23 10:11:24 +00:00
currentUser = currentUser.getCurrentUser();
2026-07-20 16:05:17 +00:00
const channel = store.getChannel(channel_id);
let tmp3 = null != currentUser && null != channel;
if (tmp3) {
2026-08-08 06:10:11 +00:00
tmp3 = !require(4517) /* shouldShowAgeGateForVoiceChannel */.isChannelContentGated(channel);
const obj = require(4517) /* shouldShowAgeGateForVoiceChannel */;
2026-07-20 16:05:17 +00:00
}
return tmp3;
};
export const getGuildIdFromMessage = function getGuildIdFromMessage(channel_id) {
const channel = store.getChannel(channel_id.channel_id);
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
};