Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4941.js (118.4 MB)
65 lines
2.3 KiB
TypeScript
65 lines
2.3 KiB
TypeScript
// Module ID: 12245
|
|
// Function ID: 12246
|
|
// Name: DraftCommandUtils
|
|
// Dependencies: [5211, 5107, 9529, 2]
|
|
// Exports: resolveDraftCommand, toDraftCommand
|
|
|
|
// Module 12245 (DraftCommandUtils)
|
|
import DraftCommand from "DraftCommand" /* 5107 */;
|
|
import ChannelAutocompleteConstants from "ChannelAutocompleteConstants" /* 5211 */;
|
|
import ApplicationCommandQueryApiAll from "ApplicationCommandQueryApi" /* 9529 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
const COMMAND_SENTINEL = ChannelAutocompleteConstants.COMMAND_SENTINEL;
|
|
const result = size.fileFinishedImporting("modules/application_commands/DraftCommandUtils.tsx");
|
|
|
|
export const toDraftCommand = function toDraftCommand(activeCommand, result1) {
|
|
if (null == activeCommand) {
|
|
return null;
|
|
} else {
|
|
let tmp2 = (function getCommandTextPrefix(activeCommand, result1) {
|
|
const items = [, ];
|
|
({ displayName: arr[0], untranslatedName: arr[1] } = activeCommand);
|
|
const obj = items[Symbol.iterator]();
|
|
while (obj !== undefined) {
|
|
let _HermesInternal = HermesInternal;
|
|
let combined = "" + COMMAND_SENTINEL + tmp;
|
|
if (result1 !== combined) {
|
|
let _HermesInternal2 = HermesInternal;
|
|
}
|
|
obj.return();
|
|
return combined;
|
|
}
|
|
return null;
|
|
})(activeCommand, result1);
|
|
let tmp3 = null;
|
|
if (null != tmp2) {
|
|
let obj = { commandId: null, applicationId: null, commandText: null };
|
|
({ id: obj.commandId, applicationId: obj.applicationId } = activeCommand);
|
|
obj.commandText = tmp2;
|
|
tmp3 = obj;
|
|
}
|
|
return tmp3;
|
|
}
|
|
};
|
|
export const resolveDraftCommand = function resolveDraftCommand(channel, text, draftCommand) {
|
|
if (null != draftCommand) {
|
|
if (obj4.isDraftCommandValidForText(draftCommand, text)) {
|
|
const obj2 = { channel, type: "channel" };
|
|
const cachedCommand = ApplicationCommandQueryApiAll.getCachedCommand(obj2, draftCommand.commandId, draftCommand.applicationId);
|
|
({ command, section } = cachedCommand);
|
|
let tmp4 = null;
|
|
if (null != command) {
|
|
const obj3 = { command, section: null };
|
|
if (section == null) {
|
|
section = null;
|
|
}
|
|
obj3.section = section;
|
|
tmp4 = obj3;
|
|
}
|
|
return tmp4;
|
|
}
|
|
obj4 = DraftCommand;
|
|
}
|
|
return null;
|
|
};
|