Applied codestyle to all .cs files

This commit is contained in:
Kwoth
2021-12-29 06:07:16 +01:00
parent 723447c7d4
commit 82000c97a4
543 changed files with 13221 additions and 14059 deletions

View File

@@ -9,10 +9,10 @@ public class AntiRaidSetting : DbEntity
public int UserThreshold { get; set; }
public int Seconds { get; set; }
public PunishmentAction Action { get; set; }
/// <summary>
/// Duration of the punishment, in minutes. This works only for supported Actions, like:
/// Mute, Chatmute, Voicemute, etc...
/// Duration of the punishment, in minutes. This works only for supported Actions, like:
/// Mute, Chatmute, Voicemute, etc...
/// </summary>
public int PunishDuration { get; set; }
}
@@ -55,10 +55,9 @@ public class AntiSpamIgnore : DbEntity
{
public ulong ChannelId { get; set; }
public override int GetHashCode() => ChannelId.GetHashCode();
public override int GetHashCode()
=> ChannelId.GetHashCode();
public override bool Equals(object obj)
=> obj is AntiSpamIgnore inst
? inst.ChannelId == ChannelId
: false;
}
=> obj is AntiSpamIgnore inst ? inst.ChannelId == ChannelId : false;
}

View File

@@ -8,7 +8,7 @@ public class AutoCommand : DbEntity
public string ChannelName { get; set; }
public ulong? GuildId { get; set; }
public string GuildName { get; set; }
public ulong? VoiceChannelId {get; set; }
public ulong? VoiceChannelId { get; set; }
public string VoiceChannelName { get; set; }
public int Interval { get; set; }
}
}

View File

@@ -7,4 +7,4 @@ public class AutoTranslateChannel : DbEntity
public ulong ChannelId { get; set; }
public bool AutoDelete { get; set; }
public IList<AutoTranslateUser> Users { get; set; } = new List<AutoTranslateUser>();
}
}

View File

@@ -8,4 +8,4 @@ public class AutoTranslateUser : DbEntity
public ulong UserId { get; set; }
public string Source { get; set; }
public string Target { get; set; }
}
}

View File

@@ -1,8 +1,8 @@
#nullable disable
namespace NadekoBot.Services.Database.Models;
public class BanTemplate : DbEntity
public class BanTemplate : DbEntity
{
public ulong GuildId { get; set; }
public string Text { get; set; }
}
}

View File

@@ -12,4 +12,4 @@ public enum BlacklistType
Server,
Channel,
User
}
}

View File

@@ -1,6 +1,6 @@
#nullable disable
using System.ComponentModel.DataAnnotations;
using NadekoBot.Services.Database.Models;
using System.ComponentModel.DataAnnotations;
namespace NadekoBot.Db.Models;
@@ -8,12 +8,13 @@ public class ClubInfo : DbEntity
{
[MaxLength(20)]
public string Name { get; set; }
public int Discrim { get; set; }
public string ImageUrl { get; set; } = string.Empty;
public int MinimumLevelReq { get; set; } = 5;
public int Xp { get; set; } = 0;
public int OwnerId { get; set; }
public DiscordUser Owner { get; set; }
@@ -43,4 +44,4 @@ public class ClubBans
public int UserId { get; set; }
public DiscordUser User { get; set; }
}
}

View File

@@ -5,4 +5,4 @@ public class CommandAlias : DbEntity
{
public string Trigger { get; set; }
public string Mapping { get; set; }
}
}

View File

@@ -5,4 +5,4 @@ public class CommandCooldown : DbEntity
{
public int Seconds { get; set; }
public string CommandName { get; set; }
}
}

View File

@@ -7,10 +7,6 @@ public class CurrencyTransaction : DbEntity
public string Reason { get; set; }
public ulong UserId { get; set; }
public CurrencyTransaction Clone() => new()
{
Amount = Amount,
Reason = Reason,
UserId = UserId,
};
}
public CurrencyTransaction Clone()
=> new() { Amount = Amount, Reason = Reason, UserId = UserId };
}

View File

@@ -13,16 +13,15 @@ public class CustomReaction : DbEntity
public bool AllowTarget { get; set; }
public string Reactions { get; set; }
public string[] GetReactions() =>
string.IsNullOrWhiteSpace(Reactions)
? Array.Empty<string>()
: Reactions.Split("@@@");
public bool IsGlobal() => GuildId is null or 0;
public string[] GetReactions()
=> string.IsNullOrWhiteSpace(Reactions) ? Array.Empty<string>() : Reactions.Split("@@@");
public bool IsGlobal()
=> GuildId is null or 0;
}
public class ReactionResponse : DbEntity
{
public bool OwnerOnly { get; set; }
public string Text { get; set; }
}
}

View File

@@ -7,5 +7,6 @@ public class DbEntity
{
[Key]
public int Id { get; set; }
public DateTime? DateAdded { get; set; } = DateTime.UtcNow;
}
}

View File

@@ -10,6 +10,5 @@ public class DelMsgOnCmdChannel : DbEntity
=> ChannelId.GetHashCode();
public override bool Equals(object obj)
=> obj is DelMsgOnCmdChannel x
&& x.ChannelId == ChannelId;
}
=> obj is DelMsgOnCmdChannel x && x.ChannelId == ChannelId;
}

View File

@@ -4,7 +4,7 @@ namespace NadekoBot.Services.Database.Models;
public class DiscordPermOverride : DbEntity
{
public GuildPerm Perm { get; set; }
public ulong? GuildId { get; set; }
public string Command { get; set; }
}
}

View File

@@ -21,13 +21,11 @@ public class DiscordUser : DbEntity
public long CurrencyAmount { get; set; }
public override bool Equals(object obj)
=> obj is DiscordUser du
? du.UserId == UserId
: false;
=> obj is DiscordUser du ? du.UserId == UserId : false;
public override int GetHashCode()
=> UserId.GetHashCode();
public override string ToString() =>
Username + "#" + Discriminator;
}
public override string ToString()
=> Username + "#" + Discriminator;
}

View File

@@ -6,7 +6,8 @@ public class CurrencyEvent
public enum Type
{
Reaction,
GameStatus,
GameStatus
//NotRaid,
}
@@ -16,30 +17,33 @@ public class CurrencyEvent
public Type EventType { get; set; }
/// <summary>
/// Amount of currency that the user will be rewarded.
/// Amount of currency that the user will be rewarded.
/// </summary>
public long Amount { get; set; }
/// <summary>
/// Maximum amount of currency that can be handed out.
/// Maximum amount of currency that can be handed out.
/// </summary>
public long PotSize { get; set; }
public List<AwardedUser> AwardedUsers { get; set; }
/// <summary>
/// Used as extra data storage for events which need it.
/// Used as extra data storage for events which need it.
/// </summary>
public ulong ExtraId { get; set; }
/// <summary>
/// May be used for some future event.
/// May be used for some future event.
/// </summary>
public ulong ExtraId2 { get; set; }
/// <summary>
/// May be used for some future event.
/// May be used for some future event.
/// </summary>
public string ExtraString { get; set; }
}
public class AwardedUser
{
}
}

View File

@@ -13,7 +13,5 @@ public class FeedSub : DbEntity
=> Url.GetHashCode(StringComparison.InvariantCulture) ^ GuildConfigId.GetHashCode();
public override bool Equals(object obj)
=> obj is FeedSub s
&& s.Url.ToLower() == Url.ToLower()
&& s.GuildConfigId == GuildConfigId;
}
=> obj is FeedSub s && s.Url.ToLower() == Url.ToLower() && s.GuildConfigId == GuildConfigId;
}

View File

@@ -5,13 +5,13 @@ public class FilterChannelId : DbEntity
{
public ulong ChannelId { get; set; }
public bool Equals(FilterChannelId other)
public bool Equals(FilterChannelId other)
=> ChannelId == other.ChannelId;
public override bool Equals(object obj)
=> obj is FilterChannelId fci && Equals(fci);
=> obj is FilterChannelId fci && Equals(fci);
public override int GetHashCode()
public override int GetHashCode()
=> ChannelId.GetHashCode();
}
@@ -19,12 +19,12 @@ public class FilterInvitesChannelId : DbEntity
{
public ulong ChannelId { get; set; }
public bool Equals(FilterInvitesChannelId other)
public bool Equals(FilterInvitesChannelId other)
=> ChannelId == other.ChannelId;
public override bool Equals(object obj)
=> obj is FilterInvitesChannelId fci && Equals(fci);
=> obj is FilterInvitesChannelId fci && Equals(fci);
public override int GetHashCode()
public override int GetHashCode()
=> ChannelId.GetHashCode();
}
}

View File

@@ -6,9 +6,8 @@ public class FilterLinksChannelId : DbEntity
public ulong ChannelId { get; set; }
public override bool Equals(object obj)
=> obj is FilterLinksChannelId f
&& f.ChannelId == ChannelId;
=> obj is FilterLinksChannelId f && f.ChannelId == ChannelId;
public override int GetHashCode()
public override int GetHashCode()
=> ChannelId.GetHashCode();
}
}

View File

@@ -4,4 +4,4 @@ namespace NadekoBot.Services.Database.Models;
public class FilteredWord : DbEntity
{
public string Word { get; set; }
}
}

View File

@@ -1,35 +1,36 @@
#nullable disable
using NadekoBot.Services.Database.Models;
using NadekoBot.Modules.Searches.Common;
using NadekoBot.Services.Database.Models;
namespace NadekoBot.Db.Models;
public class FollowedStream : DbEntity
{
public enum FType
{
Twitch = 0,
Picarto = 3,
Youtube = 4,
Facebook = 5
}
public ulong GuildId { get; set; }
public ulong ChannelId { get; set; }
public string Username { get; set; }
public FType Type { get; set; }
public string Message { get; set; }
public enum FType
{
Twitch = 0,
Picarto = 3,
Youtube = 4,
Facebook = 5,
}
protected bool Equals(FollowedStream other)
=> ChannelId == other.ChannelId
&& Username.Trim().ToUpperInvariant() == other.Username.Trim().ToUpperInvariant()
=> ChannelId == other.ChannelId
&& Username.Trim().ToUpperInvariant() == other.Username.Trim().ToUpperInvariant()
&& Type == other.Type;
public override int GetHashCode()
=> HashCode.Combine(ChannelId, Username, (int) Type);
=> HashCode.Combine(ChannelId, Username, (int)Type);
public override bool Equals(object obj)
public override bool Equals(object obj)
=> obj is FollowedStream fs && Equals(fs);
public StreamDataKey CreateKey() => new(Type, Username.ToLower());
}
public StreamDataKey CreateKey()
=> new(Type, Username.ToLower());
}

View File

@@ -7,10 +7,8 @@ public class GCChannelId : DbEntity
public ulong ChannelId { get; set; }
public override bool Equals(object obj)
=> obj is GCChannelId gc
? gc.ChannelId == ChannelId
: false;
=> obj is GCChannelId gc ? gc.ChannelId == ChannelId : false;
public override int GetHashCode() =>
this.ChannelId.GetHashCode();
}
public override int GetHashCode()
=> ChannelId.GetHashCode();
}

View File

@@ -8,4 +8,4 @@ public class GroupName : DbEntity
public int Number { get; set; }
public string Name { get; set; }
}
}

View File

@@ -12,7 +12,9 @@ public class GuildConfig : DbEntity
public bool DeleteMessageOnCommand { get; set; }
public HashSet<DelMsgOnCmdChannel> DelMsgOnCmdChannels { get; set; } = new();
public string AutoAssignRoleIds { get; set; }
//greet stuff
public bool AutoDeleteGreetMessages { get; set; } //unused
public bool AutoDeleteByeMessages { get; set; } // unused
@@ -28,15 +30,6 @@ public class GuildConfig : DbEntity
public bool SendChannelGreetMessage { get; set; }
public string ChannelGreetMessageText { get; set; } = "Welcome to the %server% server, %user%!";
#region Boost Message
public bool SendBoostMessage { get; set; }
public string BoostMessage { get; set; } = "%user% just boosted this server!";
public ulong BoostMessageChannelId { get; set; }
public int BoostMessageDeleteAfter { get; set; }
#endregion
public bool SendChannelByeMessage { get; set; }
public string ChannelByeMessageText { get; set; } = "%user% has left!";
@@ -104,4 +97,13 @@ public class GuildConfig : DbEntity
public List<GroupName> SelfAssignableRoleGroupNames { get; set; }
public int WarnExpireHours { get; set; } = 0;
public WarnExpireAction WarnExpireAction { get; set; } = WarnExpireAction.Clear;
}
#region Boost Message
public bool SendBoostMessage { get; set; }
public string BoostMessage { get; set; } = "%user% just boosted this server!";
public ulong BoostMessageChannelId { get; set; }
public int BoostMessageDeleteAfter { get; set; }
#endregion
}

View File

@@ -12,5 +12,5 @@ public class IgnoredLogItem : DbEntity
public enum IgnoredItemType
{
Channel,
User,
}
User
}

View File

@@ -5,4 +5,4 @@ public class IgnoredVoicePresenceChannel : DbEntity
{
public LogSetting LogSetting { get; set; }
public ulong ChannelId { get; set; }
}
}

View File

@@ -5,4 +5,4 @@ public class ImageOnlyChannel : DbEntity
{
public ulong GuildId { get; set; }
public ulong ChannelId { get; set; }
}
}

View File

@@ -29,4 +29,4 @@ public class LogSetting : DbEntity
public ulong? LogVoicePresenceId { get; set; }
public ulong? LogVoicePresenceTTSId { get; set; }
}
}

View File

@@ -7,4 +7,4 @@ public class MusicPlaylist : DbEntity
public string Author { get; set; }
public ulong AuthorId { get; set; }
public List<PlaylistSong> Songs { get; set; } = new();
}
}

View File

@@ -4,42 +4,42 @@ namespace NadekoBot.Services.Database.Models;
public class MusicPlayerSettings
{
/// <summary>
/// Auto generated Id
/// Auto generated Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// Id of the guild
/// Id of the guild
/// </summary>
public ulong GuildId { get; set; }
/// <summary>
/// Queue repeat type
/// Queue repeat type
/// </summary>
public PlayerRepeatType PlayerRepeat { get; set; } = PlayerRepeatType.Queue;
/// <summary>
/// Channel id the bot will always try to send track related messages to
/// Channel id the bot will always try to send track related messages to
/// </summary>
public ulong? MusicChannelId { get; set; } = null;
/// <summary>
/// Default volume player will be created with
/// Default volume player will be created with
/// </summary>
public int Volume { get; set; } = 100;
/// <summary>
/// Whether the bot should auto disconnect from the voice channel once the queue is done
/// This only has effect if
/// Whether the bot should auto disconnect from the voice channel once the queue is done
/// This only has effect if
/// </summary>
public bool AutoDisconnect { get; set; } = false;
/// <summary>
/// Selected quality preset for the music player
/// Selected quality preset for the music player
/// </summary>
public QualityPreset QualityPreset { get; set; }
}
public enum QualityPreset
{
Highest,
@@ -53,4 +53,4 @@ public enum PlayerRepeatType
None,
Track,
Queue
}
}

View File

@@ -9,7 +9,5 @@ public class MutedUserId : DbEntity
=> UserId.GetHashCode();
public override bool Equals(object obj)
=> obj is MutedUserId mui
? mui.UserId == UserId
: false;
}
=> obj is MutedUserId mui ? mui.UserId == UserId : false;
}

View File

@@ -6,9 +6,9 @@ public class NsfwBlacklistedTag : DbEntity
public ulong GuildId { get; set; }
public string Tag { get; set; }
public override int GetHashCode()
public override int GetHashCode()
=> Tag.GetHashCode(StringComparison.InvariantCulture);
public override bool Equals(object obj)
public override bool Equals(object obj)
=> obj is NsfwBlacklistedTag x && x.Tag == Tag;
}
}

View File

@@ -26,21 +26,19 @@ public class Permissionv2 : DbEntity, IIndexed
public bool State { get; set; }
[NotMapped]
public static Permissionv2 AllowAllPerm => new()
{
PrimaryTarget = PrimaryPermissionType.Server,
PrimaryTargetId = 0,
SecondaryTarget = SecondaryPermissionType.AllModules,
SecondaryTargetName = "*",
State = true,
Index = 0,
};
public static List<Permissionv2> GetDefaultPermlist =>
new()
public static Permissionv2 AllowAllPerm
=> new()
{
AllowAllPerm
PrimaryTarget = PrimaryPermissionType.Server,
PrimaryTargetId = 0,
SecondaryTarget = SecondaryPermissionType.AllModules,
SecondaryTargetName = "*",
State = true,
Index = 0
};
public static List<Permissionv2> GetDefaultPermlist
=> new() { AllowAllPerm };
}
public enum PrimaryPermissionType
@@ -56,4 +54,4 @@ public enum SecondaryPermissionType
Module,
Command,
AllModules
}
}

View File

@@ -9,4 +9,4 @@ public class PlantedCurrency : DbEntity
public ulong ChannelId { get; set; }
public ulong UserId { get; set; }
public ulong MessageId { get; set; }
}
}

View File

@@ -16,4 +16,4 @@ public enum MusicType
YouTube,
Local,
Soundcloud
}
}

View File

@@ -16,4 +16,4 @@ public class PollAnswer : DbEntity, IIndexed
{
public int Index { get; set; }
public string Text { get; set; }
}
}

View File

@@ -10,7 +10,5 @@ public class PollVote : DbEntity
=> UserId.GetHashCode();
public override bool Equals(object obj)
=> obj is PollVote p
? p.UserId == UserId
: false;
}
=> obj is PollVote p ? p.UserId == UserId : false;
}

View File

@@ -6,18 +6,21 @@ namespace NadekoBot.Services.Database.Models;
public class Quote : DbEntity
{
public ulong GuildId { get; set; }
[Required]
public string Keyword { get; set; }
[Required]
public string AuthorName { get; set; }
public ulong AuthorId { get; set; }
[Required]
public string Text { get; set; }
}
public enum OrderType
{
Id = -1,
Keyword = -2
}
}

View File

@@ -19,4 +19,4 @@ public class ReactionRole : DbEntity
{
public string EmoteName { get; set; }
public ulong RoleId { get; set; }
}
}

View File

@@ -9,4 +9,4 @@ public class Reminder : DbEntity
public ulong UserId { get; set; }
public string Message { get; set; }
public bool IsPrivate { get; set; }
}
}

View File

@@ -12,4 +12,4 @@ public class Repeater
public TimeSpan? StartTimeOfDay { get; set; }
public bool NoRedundant { get; set; }
public DateTime DateAdded { get; set; }
}
}

View File

@@ -7,4 +7,4 @@ public class RewardedUser : DbEntity
public string PatreonUserId { get; set; }
public int AmountRewardedThisMonth { get; set; }
public DateTime LastReward { get; set; }
}
}

View File

@@ -5,4 +5,4 @@ public class RotatingPlayingStatus : DbEntity
{
public string Status { get; set; }
public ActivityType Type { get; set; }
}
}

View File

@@ -5,7 +5,7 @@ public class SelfAssignedRole : DbEntity
{
public ulong GuildId { get; set; }
public ulong RoleId { get; set; }
public int Group { get; set; }
public int LevelRequirement { get; set; }
}
}

View File

@@ -4,7 +4,8 @@ namespace NadekoBot.Services.Database.Models;
public enum ShopEntryType
{
Role,
List,
List
//Infinite_List,
}
@@ -31,13 +32,10 @@ public class ShopEntryItem : DbEntity
public override bool Equals(object obj)
{
if (obj is null || GetType() != obj.GetType())
{
return false;
}
if (obj is null || GetType() != obj.GetType()) return false;
return ((ShopEntryItem)obj).Text == Text;
}
public override int GetHashCode() =>
Text.GetHashCode(StringComparison.InvariantCulture);
}
public override int GetHashCode()
=> Text.GetHashCode(StringComparison.InvariantCulture);
}

View File

@@ -8,10 +8,7 @@ public class SlowmodeIgnoredRole : DbEntity
// override object.Equals
public override bool Equals(object obj)
{
if (obj is null || GetType() != obj.GetType())
{
return false;
}
if (obj is null || GetType() != obj.GetType()) return false;
return ((SlowmodeIgnoredRole)obj).RoleId == RoleId;
}
@@ -19,4 +16,4 @@ public class SlowmodeIgnoredRole : DbEntity
// override object.GetHashCode
public override int GetHashCode()
=> RoleId.GetHashCode();
}
}

View File

@@ -8,10 +8,7 @@ public class SlowmodeIgnoredUser : DbEntity
// override object.Equals
public override bool Equals(object obj)
{
if (obj is null || GetType() != obj.GetType())
{
return false;
}
if (obj is null || GetType() != obj.GetType()) return false;
return ((SlowmodeIgnoredUser)obj).UserId == UserId;
}
@@ -19,4 +16,4 @@ public class SlowmodeIgnoredUser : DbEntity
// override object.GetHashCode
public override int GetHashCode()
=> UserId.GetHashCode();
}
}

View File

@@ -7,33 +7,33 @@ public class StreamRoleSettings : DbEntity
public GuildConfig GuildConfig { get; set; }
/// <summary>
/// Whether the feature is enabled in the guild.
/// Whether the feature is enabled in the guild.
/// </summary>
public bool Enabled { get; set; }
/// <summary>
/// Id of the role to give to the users in the role 'FromRole' when they start streaming
/// Id of the role to give to the users in the role 'FromRole' when they start streaming
/// </summary>
public ulong AddRoleId { get; set; }
/// <summary>
/// Id of the role whose users are eligible to get the 'AddRole'
/// Id of the role whose users are eligible to get the 'AddRole'
/// </summary>
public ulong FromRoleId { get; set; }
/// <summary>
/// If set, feature will only apply to users who have this keyword in their streaming status.
/// If set, feature will only apply to users who have this keyword in their streaming status.
/// </summary>
public string Keyword { get; set; }
/// <summary>
/// A collection of whitelisted users' IDs. Whitelisted users don't require 'keyword' in
/// order to get the stream role.
/// A collection of whitelisted users' IDs. Whitelisted users don't require 'keyword' in
/// order to get the stream role.
/// </summary>
public HashSet<StreamRoleWhitelistedUser> Whitelist { get; set; } = new();
/// <summary>
/// A collection of blacklisted users' IDs. Blacklisted useres will never get the stream role.
/// A collection of blacklisted users' IDs. Blacklisted useres will never get the stream role.
/// </summary>
public HashSet<StreamRoleBlacklistedUser> Blacklist { get; set; } = new();
}
@@ -61,10 +61,8 @@ public class StreamRoleWhitelistedUser : DbEntity
public string Username { get; set; }
public override bool Equals(object obj)
=> obj is StreamRoleWhitelistedUser x
? x.UserId == UserId
: false;
=> obj is StreamRoleWhitelistedUser x ? x.UserId == UserId : false;
public override int GetHashCode()
=> UserId.GetHashCode();
}
}

View File

@@ -6,11 +6,9 @@ public class UnbanTimer : DbEntity
public ulong UserId { get; set; }
public DateTime UnbanAt { get; set; }
public override int GetHashCode() =>
UserId.GetHashCode();
public override int GetHashCode()
=> UserId.GetHashCode();
public override bool Equals(object obj)
=> obj is UnbanTimer ut
? ut.UserId == UserId
: false;
}
=> obj is UnbanTimer ut ? ut.UserId == UserId : false;
}

View File

@@ -6,11 +6,9 @@ public class UnmuteTimer : DbEntity
public ulong UserId { get; set; }
public DateTime UnmuteAt { get; set; }
public override int GetHashCode() =>
UserId.GetHashCode();
public override int GetHashCode()
=> UserId.GetHashCode();
public override bool Equals(object obj)
=> obj is UnmuteTimer ut
? ut.UserId == UserId
: false;
}
=> obj is UnmuteTimer ut ? ut.UserId == UserId : false;
}

View File

@@ -7,11 +7,9 @@ public class UnroleTimer : DbEntity
public ulong RoleId { get; set; }
public DateTime UnbanAt { get; set; }
public override int GetHashCode() =>
UserId.GetHashCode() ^ RoleId.GetHashCode();
public override int GetHashCode()
=> UserId.GetHashCode() ^ RoleId.GetHashCode();
public override bool Equals(object obj)
=> obj is UnroleTimer ut
? ut.UserId == UserId && ut.RoleId == RoleId
: false;
}
=> obj is UnroleTimer ut ? ut.UserId == UserId && ut.RoleId == RoleId : false;
}

View File

@@ -11,4 +11,4 @@ public class UserXpStats : DbEntity
public DateTime LastLevelUp { get; set; } = DateTime.UtcNow;
}
public enum XpNotificationLocation { None, Dm, Channel }
public enum XpNotificationLocation { None, Dm, Channel }

View File

@@ -5,4 +5,4 @@ public class VcRoleInfo : DbEntity
{
public ulong VoiceChannelId { get; set; }
public ulong RoleId { get; set; }
}
}

View File

@@ -25,22 +25,14 @@ public class WaifuInfo : DbEntity
var waifuUsername = Waifu.Username.TrimTo(20);
var claimerUsername = Claimer?.Username.TrimTo(20);
if (ClaimerId != null)
{
claimer = $"{ claimerUsername }#{Claimer.Discriminator}";
}
if (ClaimerId != 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";
}
else
{
status = $"... but {waifuUsername}'s heart belongs to {Affinity.Username.TrimTo(20)}#{Affinity.Discriminator}";
}
status =
$"... but {waifuUsername}'s heart belongs to {Affinity.Username.TrimTo(20)}#{Affinity.Discriminator}";
return $"**{waifuUsername}#{Waifu.Discriminator}** - claimed by **{claimer}**\n\t{status}";
}
}
@@ -66,22 +58,13 @@ public class WaifuLbResult
var waifuUsername = Username.TrimTo(20);
var claimerUsername = Claimer?.TrimTo(20);
if (Claimer != null)
{
claimer = $"{ claimerUsername }#{ClaimerDiscrim}";
}
if (Claimer != null) claimer = $"{claimerUsername}#{ClaimerDiscrim}";
if (Affinity is null)
{
status = $"... but {waifuUsername}'s heart is empty";
}
else if (Affinity + AffinityDiscrim == Claimer + ClaimerDiscrim)
{
status = $"... and {waifuUsername} likes {claimerUsername} too <3";
}
else
{
status = $"... but {waifuUsername}'s heart belongs to {Affinity.TrimTo(20)}#{AffinityDiscrim}";
}
return $"**{waifuUsername}#{Discrim}** - claimed by **{claimer}**\n\t{status}";
}
}
}

View File

@@ -6,4 +6,4 @@ public class WaifuItem : DbEntity
public int? WaifuInfoId { get; set; }
public string ItemEmoji { get; set; }
public string Name { get; set; }
}
}

View File

@@ -20,4 +20,4 @@ public enum WaifuUpdateType
{
AffinityChanged,
Claimed
}
}

View File

@@ -5,4 +5,4 @@ public enum WarnExpireAction
{
Clear,
Delete
}
}

View File

@@ -10,4 +10,4 @@ public class Warning : DbEntity
public string ForgivenBy { get; set; }
public string Moderator { get; set; }
public int Weight { get; set; }
}
}

View File

@@ -7,4 +7,4 @@ public class WarningPunishment : DbEntity
public PunishmentAction Punishment { get; set; }
public int Time { get; set; }
public ulong? RoleId { get; set; }
}
}

View File

@@ -21,12 +21,12 @@ public class XpRoleReward : DbEntity
public int Level { get; set; }
public ulong RoleId { get; set; }
/// <summary>
/// Whether the role should be removed (true) or added (false)
/// Whether the role should be removed (true) or added (false)
/// </summary>
public bool Remove { get; set; }
public override int GetHashCode()
=> Level.GetHashCode() ^ XpSettingsId.GetHashCode();
@@ -59,4 +59,4 @@ public class ExcludedItem : DbEntity
public override bool Equals(object obj)
=> obj is ExcludedItem ei && ei.ItemId == ItemId && ei.ItemType == ItemType;
}
}