decord/alpha/source/modules/autocompleter/createAutocompleterResultForChannelId.tsx
github-actions 97fd043558 chore: update source for alpha 347.5
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4941.js (118.4 MB)
2026-09-19 06:52:51 +00:00

60 lines
2.1 KiB
TypeScript

// Module ID: 10099
// Function ID: 10100
// Name: createAutocompleterResultForChannelId
// Dependencies: [2041, 4405, 1372, 5727, 1074, 4909, 2]
// Exports: default
// Module 10099 (createAutocompleterResultForChannelId)
import useChannelName from "useChannelName" /* 4909 */;
import ChannelStore from "ChannelStore" /* 2041 */;
import RelationshipStore from "RelationshipStore" /* 4405 */;
import UserStore from "UserStore" /* 1372 */;
require = fn;
fn(5727).AutocompleterResultTypes;
const ChannelTypes = fn(1074).ChannelTypes;
const size = fn(2);
const result = size.fileFinishedImporting("modules/autocompleter/createAutocompleterResultForChannelId.tsx");
export default function createAutocompleterResultForChannelId(arg0, arg1, UserStore, RelationshipStore) {
let obj = arg1;
if (arg1 === undefined) {
obj = ChannelStore;
}
let obj2 = UserStore;
if (UserStore === undefined) {
obj2 = UserStore;
}
let tmp = RelationshipStore;
if (RelationshipStore === undefined) {
tmp = RelationshipStore;
}
const channel = obj.getChannel(arg0);
if (null == channel) {
return null;
} else {
const channelName = useChannelName.computeChannelName(channel, obj2, tmp);
const type = channel.type;
if (ChannelTypes.DM === type) {
const user = obj2.getUser(channel.getRecipientId());
let tmp6 = null;
if (null != user) {
const obj3 = { type: AutocompleterResultTypes.USER, record: user, score: 0, comparator: channelName };
tmp6 = obj3;
}
return tmp6;
} else if (tmp11.GROUP_DM === type) {
const obj4 = { type: AutocompleterResultTypes.GROUP_DM, record: channel, score: 0, comparator: channelName };
return obj4;
} else {
if (tmp11.GUILD_VOICE !== type) {
if (tmp11.GUILD_STAGE_VOICE !== type) {
const obj5 = { type: AutocompleterResultTypes.TEXT_CHANNEL, record: channel, score: 0, comparator: channelName };
return obj5;
}
}
const obj6 = { type: AutocompleterResultTypes.VOICE_CHANNEL, record: channel, score: 0, comparator: channelName };
return obj6;
}
}
};