decord/source/modules/messages/MessageUtils.tsx

32 lines
1.1 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 10018
// Function ID: 10019
2026-07-20 16:05:17 +00:00
// Name: canViewPotentiallyNSFWChannel
2026-08-15 05:55:55 +00:00
// Dependencies: [1391, 1922, 5252, 2]
2026-07-20 16:05:17 +00:00
// Exports: canViewPotentiallyNSFWChannel, getGuildIdFromMessage
2026-08-15 05:55:55 +00:00
// Module 10018 (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-15 05:55:55 +00:00
tmp3 = !require(5252) /* shouldShowAgeGateForVoiceChannel */.isChannelContentGated(channel);
const obj = require(5252) /* 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
};