decord/source/modules/guild_member/GuildMemberActionCreators.tsx

35 lines
1.3 KiB
TypeScript
Raw Normal View History

// Module ID: 7234
// Function ID: 7235
// Name: GuildMemberActionCreators
// Dependencies: [2015, 1074, 5640, 573, 1271, 2]
2026-07-20 16:05:17 +00:00
// Exports: updateGuildSelfMember
// Module 7234 (GuildMemberActionCreators)
import DispatcherDefault from "Dispatcher" /* 573 */;
import HTTPUtils from "HTTPUtils" /* 1271 */;
import ImpersonateActionCreators from "ImpersonateActionCreators" /* 5640 */;
import ImpersonateStore from "ImpersonateStore" /* 2015 */;
2026-07-20 16:05:17 +00:00
require = fn;
const Endpoints = fn(1074).Endpoints;
const size = fn(2);
let result = size.fileFinishedImporting("modules/guild_member/GuildMemberActionCreators.tsx");
2026-07-23 10:11:24 +00:00
export const updateGuildSelfMember = function updateGuildSelfMember(guildId, memberOptions) {
2026-07-20 16:05:17 +00:00
let flag = arg2;
if (arg2 === undefined) {
flag = false;
}
if (ImpersonateStore.isFullServerPreview(guildId)) {
const obj3 = { memberOptions };
const result = ImpersonateActionCreators.updateImpersonatedData(guildId, obj3);
2026-07-20 16:05:17 +00:00
} else {
const obj5 = { type: "GUILD_MEMBER_UPDATE_LOCAL", guildId, roles: null, flags: null };
({ roles: obj2.roles, flags: obj2.flags } = memberOptions);
DispatcherDefault.dispatch(obj5);
const HTTP = HTTPUtils.HTTP;
const request = { url: Endpoints.SET_GUILD_MEMBER(guildId), body: memberOptions, oldFormErrors: flag || undefined, rejectWithError: false };
return HTTP.patch(request);
2026-07-20 16:05:17 +00:00
}
};