1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-20 00:43:36 +03:00

Properly check for nickname presence

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2023-09-28 23:02:09 +05:00
parent 2b573ecb1a
commit b3b2a16aad
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF

View file

@ -25,8 +25,8 @@ public class ToolsCommandGroup : CommandGroup
{ {
private readonly ICommandContext _context; private readonly ICommandContext _context;
private readonly FeedbackService _feedback; private readonly FeedbackService _feedback;
private readonly GuildDataService _guildData;
private readonly IDiscordRestGuildAPI _guildApi; private readonly IDiscordRestGuildAPI _guildApi;
private readonly GuildDataService _guildData;
private readonly IDiscordRestUserAPI _userApi; private readonly IDiscordRestUserAPI _userApi;
public ToolsCommandGroup( public ToolsCommandGroup(
@ -153,10 +153,10 @@ public class ToolsCommandGroup : CommandGroup
private static void AppendGuildInformation(IGuildMember guildMember, StringBuilder builder) private static void AppendGuildInformation(IGuildMember guildMember, StringBuilder builder)
{ {
if (guildMember.Nickname.Value is not null) if (guildMember.Nickname.IsDefined(out var nickname))
{ {
builder.Append("- ").AppendLine(Messages.ShowInfoGuildNickname) builder.Append("- ").AppendLine(Messages.ShowInfoGuildNickname)
.AppendLine(Markdown.InlineCode(guildMember.Nickname.Value)); .AppendLine(Markdown.InlineCode(nickname));
} }
builder.Append("- ").AppendLine(Messages.ShowInfoGuildMemberSince) builder.Append("- ").AppendLine(Messages.ShowInfoGuildMemberSince)