decord/source/modules/channel/getChannelIcon.tsx
github-actions 7450227d0b chore: update source for alpha 345.4
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9596_m.js (380.6 MB)
2026-09-04 17:41:35 +00:00

59 lines
2.1 KiB
TypeScript

// Module ID: 12962
// Function ID: 12963
// Name: getChannelIconURL
// Dependencies: [32, 1921, 673, 1394, 1431, 2]
// Exports: getChannelIconSource, getChannelIconURL
// Module 12962 (getChannelIconURL)
import isDiscordFrontendDevelopment from "isDiscordFrontendDevelopment" /* 1394 */;
import getAvatarURLDefault from "getAvatarURL" /* 1431 */;
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "mergeGuildAvatar" /* 1921 */;
import { ChannelTypes } from "ME" /* 673 */;
require = arg1;
const result = require("set").fileFinishedImporting("modules/channel/getChannelIcon.tsx");
export const getChannelIconURL = function getChannelIconURL(type) {
let num = arg1;
if (arg1 === undefined) {
num = 32;
}
type = type.type;
if (ChannelTypes.DM === type) {
const recipients = type.recipients;
const mapped = recipients.map(closure_4.getUser);
const first = callback(mapped.filter(isDiscordFrontendDevelopment.isNotNullish), 1)[0];
let avatarURL = null;
if (null != first) {
avatarURL = first.getAvatarURL(undefined, num, arg2);
}
return avatarURL;
} else if (tmp.GROUP_DM === type) {
let obj = getAvatarURLDefault;
obj = { id: null, icon: null, applicationId: null, size: null };
({ id: obj2[0], icon: obj2[1] } = type);
obj[2] = type.getApplicationId();
obj[3] = num;
return obj.getChannelIconURL(obj);
}
};
export const getChannelIconSource = function getChannelIconSource(type) {
type = type.type;
if (ChannelTypes.DM === type) {
const recipients = type.recipients;
const mapped = recipients.map(closure_4.getUser);
const first = callback(mapped.filter(isDiscordFrontendDevelopment.isNotNullish), 1)[0];
let avatarSource = null;
if (null != first) {
avatarSource = first.getAvatarSource(undefined);
}
return avatarSource;
} else if (tmp.GROUP_DM === type) {
let obj = getAvatarURLDefault;
obj = { id: null, icon: null, applicationId: null, size: 128 };
({ id: obj2[0], icon: obj2[1] } = type);
obj[2] = type.getApplicationId();
return obj.getChannelIconSource(obj);
}
};