🐛 Fix bots errors

This commit is contained in:
2025-08-23 17:06:52 +08:00
parent c7925d98c8
commit 541e2dd14c
2 changed files with 12 additions and 24 deletions

View File

@@ -89,29 +89,16 @@ public class BotAccountService(
}
}
public async Task<BotAccount> UpdateBotAsync(BotAccount bot,
public async Task<BotAccount> UpdateBotAsync(
BotAccount bot,
Account account,
string? pictureId,
string? backgroundId,
string? slug = null,
bool? isActive = null
string? backgroundId
)
{
var updated = false;
if (slug != null && bot.Slug != slug)
{
bot.Slug = slug;
updated = true;
}
if (isActive.HasValue && bot.IsActive != isActive.Value)
{
bot.IsActive = isActive.Value;
updated = true;
}
if (!updated) return bot;
db.Update(bot);
await db.SaveChangesAsync();
try
{
// Update the bot account in the Pass service