mirror of
https://github.com/NoiTheCat/BirthdayBot.git
synced 2024-11-21 21:54:36 +00:00
Mark remaining preconditions as obsolete
This commit is contained in:
parent
e4f5c90aab
commit
bbb640df56
4 changed files with 5 additions and 9 deletions
|
@ -6,6 +6,7 @@ namespace BirthdayBot.ApplicationCommands;
|
||||||
/// Precondition requiring the executing user be recognized as a bot moderator.<br/>
|
/// Precondition requiring the executing user be recognized as a bot moderator.<br/>
|
||||||
/// A bot moderator has either the Manage Server permission or is a member of the designated bot moderator role.
|
/// A bot moderator has either the Manage Server permission or is a member of the designated bot moderator role.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete("Replace with appropriate DefaultMemberPermissionsAttribute")]
|
||||||
class RequireBotModeratorAttribute : PreconditionAttribute {
|
class RequireBotModeratorAttribute : PreconditionAttribute {
|
||||||
public const string Error = "User did not pass the mod check.";
|
public const string Error = "User did not pass the mod check.";
|
||||||
public const string Reply = ":x: You must be a moderator to use this command.";
|
public const string Reply = ":x: You must be a moderator to use this command.";
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace BirthdayBot.ApplicationCommands;
|
||||||
/// Implements the included precondition from Discord.Net, requiring a guild context while using our custom error message.<br/><br/>
|
/// Implements the included precondition from Discord.Net, requiring a guild context while using our custom error message.<br/><br/>
|
||||||
/// Combining this with <see cref="RequireBotModeratorAttribute"/> is redundant. If possible, only use the latter instead.
|
/// Combining this with <see cref="RequireBotModeratorAttribute"/> is redundant. If possible, only use the latter instead.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete("Replace with EnableInDmAttribute")]
|
||||||
class RequireGuildContextAttribute : RequireContextAttribute {
|
class RequireGuildContextAttribute : RequireContextAttribute {
|
||||||
public const string Error = "Command not received within a guild context.";
|
public const string Error = "Command not received within a guild context.";
|
||||||
public const string Reply = ":x: This command is only available within a server.";
|
public const string Reply = ":x: This command is only available within a server.";
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<Version>3.4.6</Version>
|
<Version>3.4.7</Version>
|
||||||
<Authors>NoiTheCat</Authors>
|
<Authors>NoiTheCat</Authors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,6 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||||
namespace BirthdayBot.Data;
|
namespace BirthdayBot.Data;
|
||||||
[Table("settings")]
|
[Table("settings")]
|
||||||
public class GuildConfig {
|
public class GuildConfig {
|
||||||
public GuildConfig() {
|
|
||||||
BlockedUsers = new HashSet<BlocklistEntry>();
|
|
||||||
UserEntries = new HashSet<UserEntry>();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Key]
|
[Key]
|
||||||
public ulong GuildId { get; set; }
|
public ulong GuildId { get; set; }
|
||||||
|
|
||||||
|
@ -23,6 +18,7 @@ public class GuildConfig {
|
||||||
|
|
||||||
public bool Moderated { get; set; }
|
public bool Moderated { get; set; }
|
||||||
|
|
||||||
|
[Obsolete("To be removed when RequireBotModeratorAttribute is also removed")]
|
||||||
public ulong? ModeratorRole { get; set; }
|
public ulong? ModeratorRole { get; set; }
|
||||||
|
|
||||||
public string? AnnounceMessage { get; set; }
|
public string? AnnounceMessage { get; set; }
|
||||||
|
@ -33,10 +29,8 @@ public class GuildConfig {
|
||||||
|
|
||||||
public DateTimeOffset LastSeen { get; set; }
|
public DateTimeOffset LastSeen { get; set; }
|
||||||
|
|
||||||
[InverseProperty(nameof(BlocklistEntry.Guild))]
|
|
||||||
public ICollection<BlocklistEntry> BlockedUsers { get; set; }
|
|
||||||
[InverseProperty(nameof(UserEntry.Guild))]
|
[InverseProperty(nameof(UserEntry.Guild))]
|
||||||
public ICollection<UserEntry> UserEntries { get; set; }
|
public ICollection<UserEntry> UserEntries { get; set; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets if this instance is new and does not (yet) exist in the database.
|
/// Gets if this instance is new and does not (yet) exist in the database.
|
||||||
|
|
Loading…
Reference in a new issue