[Bug Fix] Fix bot guild removal. (#2194)

This commit is contained in:
Kinglykrab 2022-05-22 22:31:03 -04:00 committed by GitHub
parent 992e4ac59e
commit 5b90d26a33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6788,7 +6788,7 @@ bool Bot::ProcessGuildRemoval(Client* guildOfficer, std::string botName) {
if(guildOfficer && !botName.empty()) {
Bot* botToUnGuild = entity_list.GetBotByBotName(botName);
if(botToUnGuild) {
if (database.botdb.SaveGuildMembership(botToUnGuild->GetBotID(), 0, 0))
if (database.botdb.DeleteGuildMembership(botToUnGuild->GetBotID()))
Result = true;
} else {
uint32 ownerId = 0;
@ -6797,7 +6797,7 @@ bool Bot::ProcessGuildRemoval(Client* guildOfficer, std::string botName) {
uint32 botId = 0;
if (!database.botdb.LoadBotID(ownerId, botName, botId))
guildOfficer->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadBotID(), botName.c_str());
if (botId && database.botdb.SaveGuildMembership(botId, 0, 0))
if (botId && database.botdb.DeleteGuildMembership(botId))
Result = true;
}