From f785efcbc0d0e29cede1be68f5cbb35240e181af Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Mon, 6 Nov 2023 23:39:26 +0500 Subject: [PATCH] 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 --- src/Responders/GuildLoadedResponder.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Responders/GuildLoadedResponder.cs b/src/Responders/GuildLoadedResponder.cs index bbf4a0a..5d5d68a 100644 --- a/src/Responders/GuildLoadedResponder.cs +++ b/src/Responders/GuildLoadedResponder.cs @@ -64,7 +64,14 @@ public class GuildLoadedResponder : IResponder 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)) {