1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 09:09:00 +03:00

Add more information to guild loaded log message (#179)

This PR adds additional information in the log about guilds as they are
being loaded. The new information is the owner tag & ID and member count
This commit is contained in:
Octol1ttle 2023-11-06 23:39:26 +05:00 committed by GitHub
parent f12d6d13c5
commit f785efcbc0
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,7 +64,14 @@ public class GuildLoadedResponder : IResponder<IGuildCreate>
return await SendDataLoadFailed(guild, data, bot, ct);
}
_logger.LogInformation("Loaded guild {ID} (\"{Name}\")", guild.ID, guild.Name);
var ownerResult = await _userApi.GetUserAsync(guild.OwnerID, ct);
if (!ownerResult.IsDefined(out var owner))
{
return Result.FromError(ownerResult);
}
_logger.LogInformation("Loaded guild \"{Name}\" ({ID}) owned by {Owner} ({OwnerID}) with {MemberCount} members",
guild.Name, guild.ID, owner.GetTag(), owner.ID, guild.MemberCount);
if (!GuildSettings.ReceiveStartupMessages.Get(cfg))
{