128 lines
6.0 KiB
TypeScript
128 lines
6.0 KiB
TypeScript
/* Metro module 13055; source: modules/rpc/server/commands/soundboard.tsx; dependencies: [5, 4613, 1878, 4135, 482, 4122, 6944, 6639, 8079, 6980, 6951, 8076, 6982, 6789, 2] */
|
|
function _fun99677(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99677, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13245:6, offset: 0x021d11fe, size: 385 bytes, params: 8, frame: 26
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
|
const soundboardStore = importDefault(4613) /* metro dependency 4613: SoundboardStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
let value = require(4135) /* metro dependency 4135: Constants */;
|
|
const RPC_LOCAL_SCOPE = value.RPC_LOCAL_SCOPE;
|
|
const RPC_SCOPE_CONFIG = value.RPC_SCOPE_CONFIG;
|
|
value = require(482) /* metro dependency 482: Constants */;
|
|
const RPCCommands = value.RPCCommands;
|
|
const env0_6 = value.RPCErrors;
|
|
object2 = {};
|
|
const GET_SOUNDBOARD_SOUNDS = RPCCommands.GET_SOUNDBOARD_SOUNDS;
|
|
const ANY = RPC_SCOPE_CONFIG.ANY;
|
|
const OAuth2Scopes = (require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes;
|
|
let RPC = OAuth2Scopes.RPC;
|
|
object2[GET_SOUNDBOARD_SOUNDS] = {scope: {[ANY]: [RPC, RPC_LOCAL_SCOPE]}, handler: handler_99678};
|
|
const PLAY_SOUNDBOARD_SOUND = RPCCommands.PLAY_SOUNDBOARD_SOUND;
|
|
const ALL = RPC_SCOPE_CONFIG.ALL;
|
|
RPC = OAuth2Scopes.RPC;
|
|
const RPC_VOICE_WRITE = OAuth2Scopes.RPC_VOICE_WRITE;
|
|
object2[PLAY_SOUNDBOARD_SOUND] = {scope: {[ALL]: [RPC, RPC_VOICE_WRITE]}, validation: validation_99683,
|
|
handler: handler_99684};
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/commands/soundboard.tsx');
|
|
exports.default = object2;
|
|
}
|
|
|
|
function handler_99678() { // fn#99678, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13245:300, offset: 0x021d137f, size: 29 bytes, params: 1, frame: 11
|
|
return env0_3(_fun99680)();
|
|
}
|
|
|
|
function validation_99683(a0) { // fn#99683, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13245:592, offset: 0x021d1463, size: 84 bytes, params: 2, frame: 13
|
|
let value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0);
|
|
value = value.required();
|
|
const keys = value.keys;
|
|
const object2 = {};
|
|
object2.guild_id = a0.string();
|
|
object2.sound_id = a0.string();
|
|
return Reflect.apply(keys, value, [object2]);
|
|
}
|
|
|
|
function handler_99684({args}) { // fn#99684, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13245:673, offset: 0x021d14b7, size: 57 bytes, params: 2, frame: 11
|
|
const env0_0 = args.guild_id;
|
|
const env0_1 = args.sound_id;
|
|
return env0_3(_fun99686)();
|
|
}
|
|
|
|
function* _fun99680() { // fn#99680, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13245:307, offset: 0x021d13a7, size: 106 bytes, params: 1, frame: 15
|
|
var environment;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
const value3 = env2_0(env2_2[6]);
|
|
yield value3.maybeFetchSoundboardSounds();
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
env2_4.getSounds().forEach(function(a0) {
|
|
return a0.forEach(_fun99682);
|
|
});
|
|
return [];
|
|
}
|
|
|
|
function* _fun99686() { // fn#99686, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13245:710, offset: 0x021d14fb, size: 486 bytes, params: 1, frame: 23
|
|
var binding3;
|
|
var value17;
|
|
var playSound;
|
|
var id;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
let binding = env2_0;
|
|
const value3 = binding(env2_2[6]);
|
|
yield value3.maybeFetchSoundboardSounds();
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
const currentUser = env2_5.getCurrentUser();
|
|
const sound = env2_4.getSound(require, importDefault);
|
|
const value9 = env2_1(env2_2[9])();
|
|
const r6 = sound != null && currentUser != null && env2_0(env2_2[10]).canUseSoundboardSound(currentUser, sound,
|
|
value9);
|
|
if (value9 == null) {
|
|
throw new env2_1(env2_2[11])({errorCode: env2_6.INVALID_CHANNEL}, 'Invalid Channel.');
|
|
}
|
|
binding = env2_1;
|
|
const binding2 = env2_2;
|
|
if (r6) {
|
|
if (binding(binding2[12])(value9)) {
|
|
if (sound != null) {
|
|
binding = env2_0;
|
|
binding3 = env2_2;
|
|
value17 = binding(binding3[10]);
|
|
playSound = value17.playSound;
|
|
id = value9.id;
|
|
binding = env2_1;
|
|
Reflect.apply(playSound, value17, [sound, id, [binding(binding3[13]).RPC]]);
|
|
}
|
|
return undefined;
|
|
}
|
|
binding = env2_1;
|
|
throw new binding(env2_2[11])({errorCode: env2_6.INVALID_PERMISSIONS}, 'Invalid Permissions.');
|
|
}
|
|
const value13 = binding(binding2[11]);
|
|
const INVALID_SOUND = env2_6.INVALID_SOUND;
|
|
throw new value13({errorCode: INVALID_SOUND}, 'Invalid Sound.');
|
|
}
|
|
|
|
function _fun99681(a0) { // fn#99681, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13245:405, offset: 0x021d1411, size: 24 bytes, params: 2, frame: 11
|
|
return a0.forEach(_fun99682);
|
|
}
|
|
|
|
function _fun99682(a0) { // fn#99682, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13245:419, offset: 0x021d1429, size: 58 bytes, params: 2, frame: 13
|
|
let value = environment.__proto__;
|
|
const binding = env1_0;
|
|
const push = binding.push;
|
|
value = environment.__proto__.__proto__.__proto__.__proto__;
|
|
value = env4_0(env4_2[7]);
|
|
return Reflect.apply(push, binding, [value.soundboardSoundToAPI(a0)]);
|
|
}
|
|
|