mirror of
				https://gitlab.com/Kwoth/nadekobot.git
				synced 2025-11-04 00:34:26 -05:00 
			
		
		
		
	Fixed .clubapply hopefully, and removed some redundant discriminators
This commit is contained in:
		@@ -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;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -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}";
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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 ?? "")));
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -239,7 +239,7 @@ public partial class Gambling : GamblingModule<GamblingService>
 | 
			
		||||
 | 
			
		||||
        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<GamblingService>
 | 
			
		||||
 | 
			
		||||
        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}");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
        {
 | 
			
		||||
 
 | 
			
		||||
@@ -27,8 +27,7 @@ public interface IClubService
 | 
			
		||||
public enum ClubApplyResult
 | 
			
		||||
{
 | 
			
		||||
    Success,
 | 
			
		||||
 | 
			
		||||
    AlreadyInAClub,
 | 
			
		||||
    Banned,
 | 
			
		||||
    InsufficientLevel
 | 
			
		||||
    AlreadyApplied
 | 
			
		||||
}
 | 
			
		||||
@@ -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.",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user