diff --git a/src/NadekoBot/Db/Models/DiscordUser.cs b/src/NadekoBot/Db/Models/DiscordUser.cs index 61622a53c..1d967c3ae 100644 --- a/src/NadekoBot/Db/Models/DiscordUser.cs +++ b/src/NadekoBot/Db/Models/DiscordUser.cs @@ -28,5 +28,10 @@ public class DiscordUser : DbEntity => UserId.GetHashCode(); public override string ToString() - => Username + "#" + Discriminator; + { + if (string.IsNullOrWhiteSpace(Discriminator) || Discriminator == "0000") + return Username; + + return Username + "#" + Discriminator; + } } \ No newline at end of file diff --git a/src/NadekoBot/Db/Models/Waifu.cs b/src/NadekoBot/Db/Models/Waifu.cs index 39bb3de41..43a51dec7 100644 --- a/src/NadekoBot/Db/Models/Waifu.cs +++ b/src/NadekoBot/Db/Models/Waifu.cs @@ -19,25 +19,25 @@ public class WaifuInfo : DbEntity public override string ToString() { - var claimer = "no one"; var status = string.Empty; - var waifuUsername = Waifu.Username.TrimTo(20); - var claimerUsername = Claimer?.Username.TrimTo(20); + var waifuUsername = Waifu.ToString().TrimTo(20); + var claimer = Claimer?.ToString().TrimTo(20) + ?? "no one"; + + var affinity = Affinity?.ToString().TrimTo(20); - if (ClaimerId is not null) - claimer = $"{claimerUsername}#{Claimer.Discriminator}"; if (AffinityId is null) status = $"... but {waifuUsername}'s heart is empty"; else if (AffinityId == ClaimerId) - status = $"... and {waifuUsername} likes {claimerUsername} too <3"; + status = $"... and {waifuUsername} likes {claimer} too <3"; else { status = - $"... but {waifuUsername}'s heart belongs to {Affinity.Username.TrimTo(20)}#{Affinity.Discriminator}"; + $"... but {waifuUsername}'s heart belongs to {affinity}"; } - return $"**{waifuUsername}#{Waifu.Discriminator}** - claimed by **{claimer}**\n\t{status}"; + return $"**{waifuUsername}** - claimed by **{claimer}**\n\t{status}"; } } diff --git a/src/NadekoBot/Modules/Administration/ServerLog/ServerLogCommandService.cs b/src/NadekoBot/Modules/Administration/ServerLog/ServerLogCommandService.cs index 03e21ccf3..f20d39ee1 100644 --- a/src/NadekoBot/Modules/Administration/ServerLog/ServerLogCommandService.cs +++ b/src/NadekoBot/Modules/Administration/ServerLog/ServerLogCommandService.cs @@ -363,7 +363,7 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor if (before.Username != after.Username) { embed.WithTitle("👥 " + GetText(g, strs.username_changed)) - .WithDescription($"{before.Username}#{before.Discriminator} | {before.Id}") + .WithDescription($"{before.Username} | {before.Id}") .AddField("Old Name", $"{before.Username}", true) .AddField("New Name", $"{after.Username}", true) .WithFooter(CurrentTime(g)) @@ -905,7 +905,7 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor str = "🎙" + Format.Code(PrettyCurrentTime(usr.Guild)) + GetText(logChannel.Guild, - strs.user_vmoved("👤" + Format.Bold(usr.Username + "#" + usr.Discriminator), + strs.user_vmoved("👤" + Format.Bold(usr.Username), Format.Bold(beforeVch?.Name ?? ""), Format.Bold(afterVch?.Name ?? ""))); } @@ -914,7 +914,7 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor str = "🎙" + Format.Code(PrettyCurrentTime(usr.Guild)) + GetText(logChannel.Guild, - strs.user_vjoined("👤" + Format.Bold(usr.Username + "#" + usr.Discriminator), + strs.user_vjoined("👤" + Format.Bold(usr.Username), Format.Bold(afterVch?.Name ?? ""))); } else if (afterVch is null) @@ -922,7 +922,7 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor str = "🎙" + Format.Code(PrettyCurrentTime(usr.Guild)) + GetText(logChannel.Guild, - strs.user_vleft("👤" + Format.Bold(usr.Username + "#" + usr.Discriminator), + strs.user_vleft("👤" + Format.Bold(usr.Username), Format.Bold(beforeVch.Name ?? ""))); } diff --git a/src/NadekoBot/Modules/Gambling/Gambling.cs b/src/NadekoBot/Modules/Gambling/Gambling.cs index c08f97e76..07d2a57bb 100644 --- a/src/NadekoBot/Modules/Gambling/Gambling.cs +++ b/src/NadekoBot/Modules/Gambling/Gambling.cs @@ -239,7 +239,7 @@ public partial class Gambling : GamblingModule var usr = membersArray[new NadekoRandom().Next(0, membersArray.Length)]; await SendConfirmAsync("🎟 " + GetText(strs.raffled_user), - $"**{usr.Username}#{usr.Discriminator}**", + $"**{usr.Username}**", footer: $"ID: {usr.Id}"); } @@ -258,7 +258,7 @@ public partial class Gambling : GamblingModule var usr = membersArray[new NadekoRandom().Next(0, membersArray.Length)]; await SendConfirmAsync("🎟 " + GetText(strs.raffled_user), - $"**{usr.Username}#{usr.Discriminator}**", + $"**{usr.Username}**", footer: $"ID: {usr.Id}"); } diff --git a/src/NadekoBot/Modules/Xp/Club/Club.cs b/src/NadekoBot/Modules/Xp/Club/Club.cs index 8d699465f..7f2dfbf49 100644 --- a/src/NadekoBot/Modules/Xp/Club/Club.cs +++ b/src/NadekoBot/Modules/Xp/Club/Club.cs @@ -259,8 +259,8 @@ public partial class Xp await ReplyConfirmLocalizedAsync(strs.club_applied(Format.Bold(club.ToString()))); else if (result == ClubApplyResult.Banned) await ReplyErrorLocalizedAsync(strs.club_join_banned); - else if (result == ClubApplyResult.InsufficientLevel) - await ReplyErrorLocalizedAsync(strs.club_insuff_lvl); + else if (result == ClubApplyResult.AlreadyApplied) + await ReplyErrorLocalizedAsync(strs.club_already_applied); else if (result == ClubApplyResult.AlreadyInAClub) await ReplyErrorLocalizedAsync(strs.club_already_in); } diff --git a/src/NadekoBot/Modules/Xp/Club/ClubService.cs b/src/NadekoBot/Modules/Xp/Club/ClubService.cs index 48e2360d1..7a569c5f2 100644 --- a/src/NadekoBot/Modules/Xp/Club/ClubService.cs +++ b/src/NadekoBot/Modules/Xp/Club/ClubService.cs @@ -146,7 +146,7 @@ public class ClubService : INService, IClubService return ClubApplyResult.Banned; if (club.Applicants.Any(x => x.UserId == du.Id)) - return ClubApplyResult.InsufficientLevel; + return ClubApplyResult.AlreadyApplied; var app = new ClubApplicants { diff --git a/src/NadekoBot/Modules/Xp/Club/IClubService.cs b/src/NadekoBot/Modules/Xp/Club/IClubService.cs index 5f4866044..8f090e451 100644 --- a/src/NadekoBot/Modules/Xp/Club/IClubService.cs +++ b/src/NadekoBot/Modules/Xp/Club/IClubService.cs @@ -27,8 +27,7 @@ public interface IClubService public enum ClubApplyResult { Success, - AlreadyInAClub, Banned, - InsufficientLevel + AlreadyApplied } \ No newline at end of file diff --git a/src/NadekoBot/data/strings/responses/responses.en-US.json b/src/NadekoBot/data/strings/responses/responses.en-US.json index 50a16a795..6767d3053 100644 --- a/src/NadekoBot/data/strings/responses/responses.en-US.json +++ b/src/NadekoBot/data/strings/responses/responses.en-US.json @@ -838,7 +838,7 @@ "server_leaderboard": "Server XP Leaderboard", "global_leaderboard": "Global XP Leaderboard", "modified": "Modified server XP of the user {0} by {1}", - "club_insuff_lvl": "You're insufficient level to join that club.", + "club_already_applied": "You've already applied to that club.", "club_join_banned": "You're banned from that club.", "club_already_in": "You are already a member of a club.", "club_create_error_name": "Failed creating the club. A club with that name already exists.",