mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Added check of bot info with correct lang code to bot management box.
This commit is contained in:
parent
66e7f1d490
commit
efa19d5782
1 changed files with 45 additions and 20 deletions
|
@ -1809,16 +1809,28 @@ void Controller::saveTitle() {
|
||||||
).fail(std::move(onFail)
|
).fail(std::move(onFail)
|
||||||
).send();
|
).send();
|
||||||
} else if (_isBot) {
|
} else if (_isBot) {
|
||||||
using Flag = MTPbots_SetBotInfo::Flag;
|
_api.request(MTPbots_GetBotInfo(
|
||||||
_api.request(MTPbots_SetBotInfo(
|
MTP_flags(MTPbots_GetBotInfo::Flag::f_bot),
|
||||||
MTP_flags(Flag::f_bot | Flag::f_name),
|
|
||||||
_peer->asUser()->inputUser,
|
_peer->asUser()->inputUser,
|
||||||
MTPstring(), // Lang code.
|
MTPstring() // Lang code.
|
||||||
MTP_string(*_savingData.title), // Name.
|
)).done([=](const MTPbots_BotInfo &result) {
|
||||||
MTPstring(), // About.
|
const auto was = qs(result.data().vname());
|
||||||
MTPstring() // Description.
|
const auto now = *_savingData.title;
|
||||||
)).done([=] {
|
if (was == now) {
|
||||||
continueSave();
|
return continueSave();
|
||||||
|
}
|
||||||
|
using Flag = MTPbots_SetBotInfo::Flag;
|
||||||
|
_api.request(MTPbots_SetBotInfo(
|
||||||
|
MTP_flags(Flag::f_bot | Flag::f_name),
|
||||||
|
_peer->asUser()->inputUser,
|
||||||
|
MTPstring(), // Lang code.
|
||||||
|
MTP_string(now), // Name.
|
||||||
|
MTPstring(), // About.
|
||||||
|
MTPstring() // Description.
|
||||||
|
)).done([=] {
|
||||||
|
continueSave();
|
||||||
|
}).fail(std::move(onFail)
|
||||||
|
).send();
|
||||||
}).fail(std::move(onFail)
|
}).fail(std::move(onFail)
|
||||||
).send();
|
).send();
|
||||||
} else {
|
} else {
|
||||||
|
@ -1836,19 +1848,32 @@ void Controller::saveDescription() {
|
||||||
continueSave();
|
continueSave();
|
||||||
};
|
};
|
||||||
if (_isBot) {
|
if (_isBot) {
|
||||||
using Flag = MTPbots_SetBotInfo::Flag;
|
_api.request(MTPbots_GetBotInfo(
|
||||||
_api.request(MTPbots_SetBotInfo(
|
MTP_flags(MTPbots_GetBotInfo::Flag::f_bot),
|
||||||
MTP_flags(Flag::f_bot | Flag::f_about),
|
|
||||||
_peer->asUser()->inputUser,
|
_peer->asUser()->inputUser,
|
||||||
MTPstring(), // Lang code.
|
MTPstring() // Lang code.
|
||||||
MTPstring(), // Name.
|
)).done([=](const MTPbots_BotInfo &result) {
|
||||||
MTP_string(*_savingData.description), // About.
|
const auto was = qs(result.data().vabout());
|
||||||
MTPstring() // Description.
|
const auto now = *_savingData.description;
|
||||||
)).done([=] {
|
if (was == now) {
|
||||||
successCallback();
|
return continueSave();
|
||||||
|
}
|
||||||
|
using Flag = MTPbots_SetBotInfo::Flag;
|
||||||
|
_api.request(MTPbots_SetBotInfo(
|
||||||
|
MTP_flags(Flag::f_bot | Flag::f_about),
|
||||||
|
_peer->asUser()->inputUser,
|
||||||
|
MTPstring(), // Lang code.
|
||||||
|
MTPstring(), // Name.
|
||||||
|
MTP_string(now), // About.
|
||||||
|
MTPstring() // Description.
|
||||||
|
)).done([=] {
|
||||||
|
successCallback();
|
||||||
|
}).fail([=] {
|
||||||
|
_controls.description->showError();
|
||||||
|
cancelSave();
|
||||||
|
}).send();
|
||||||
}).fail([=] {
|
}).fail([=] {
|
||||||
_controls.description->showError();
|
continueSave();
|
||||||
cancelSave();
|
|
||||||
}).send();
|
}).send();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue