28 lines
963 B
TypeScript
28 lines
963 B
TypeScript
// Metro module 6181 (f6182).
|
|
import { Endpoints } from "../Constants";
|
|
import { HTTP, rejectWithMigratedError } from "../_bundle/sendRequest";
|
|
import MessageActionCreators from "./MessageActionCreators";
|
|
import { intl, t } from "../intl/index.native";
|
|
const r16 = {
|
|
changeNickname: (a0, c15560_0, a2, nick) => HTTP.patch({
|
|
url: Endpoints.GUILD_MEMBER_NICK(a0, a2),
|
|
body: {
|
|
nick
|
|
},
|
|
oldFormErrors: true,
|
|
rejectWithError: rejectWithMigratedError()
|
|
}).then((result) => {
|
|
nick = result.body.nick;
|
|
MessageActionCreators.sendBotMessage(c15560_0, nick != null && nick !== "" ? intl.formatToMarkdownString(t["gz+HRq"], {
|
|
nick
|
|
}) : intl.string(t.Vhpd9A));
|
|
}, (a0) => {
|
|
if (a0.status === 403) {
|
|
MessageActionCreators.sendBotMessage(c15560_0, intl.formatToMarkdownString(t.Izf9jO, {}));
|
|
} else {
|
|
MessageActionCreators.sendBotMessage(c15560_0, intl.string(t["5LO/Ss"]));
|
|
}
|
|
})
|
|
};
|
|
export default r16;
|