-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add JsonPropertyNameAttribute to config values
- Loading branch information
1 parent
5599ced
commit f927128
Showing
6 changed files
with
30 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Hammer.Configuration; | ||
|
||
/// <summary> | ||
/// Represents a channel configuration. | ||
/// </summary> | ||
[SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Local", Justification = "Immutability. Setter accessible via DI")] | ||
internal sealed class ChannelConfiguration | ||
{ | ||
/// <summary> | ||
/// Gets or sets the ID of the staff log channel. | ||
/// </summary> | ||
/// <value>The ID of the staff log channel.</value> | ||
[JsonPropertyName("logChannelId")] | ||
public ulong LogChannelId { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
using System; | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Hammer.Configuration; | ||
|
||
/// <summary> | ||
/// Represents a mute configuration. | ||
/// </summary> | ||
[SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Local", Justification = "Immutability. Setter accessible via DI")] | ||
internal sealed class MuteConfiguration | ||
{ | ||
/// <summary> | ||
/// Gets or sets the duration of a gag. | ||
/// </summary> | ||
/// <value>The duration of a gag, in milliseconds.</value> | ||
[JsonPropertyName("gagDuration")] | ||
public long GagDuration { get; set; } = (long) TimeSpan.FromMinutes(5).TotalMilliseconds; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,37 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Hammer.Configuration; | ||
|
||
/// <summary> | ||
/// Represents a reaction configuration. | ||
/// </summary> | ||
[SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Local", Justification = "Immutability. Setter accessible via DI")] | ||
internal sealed class ReactionConfiguration | ||
{ | ||
/// <summary> | ||
/// Gets or sets the delete message reaction. | ||
/// </summary> | ||
/// <value>The delete message reaction.</value> | ||
[JsonPropertyName("deleteMessageReaction")] | ||
public string DeleteMessageReaction { get; set; } = ":wastebasket:"; | ||
|
||
/// <summary> | ||
/// Gets or sets the gag reaction. | ||
/// </summary> | ||
/// <value>The gag reaction.</value> | ||
[JsonPropertyName("gagReaction")] | ||
public string GagReaction { get; set; } = ":mute:"; | ||
|
||
/// <summary> | ||
/// Gets or sets the history reaction. | ||
/// </summary> | ||
/// <value>The history reaction.</value> | ||
[JsonPropertyName("historyReaction")] | ||
public string HistoryReaction { get; set; } = ":clock4:"; | ||
|
||
/// <summary> | ||
/// Gets or sets the report reaction. | ||
/// </summary> | ||
/// <value>The report reaction.</value> | ||
[JsonPropertyName("reportReaction")] | ||
public string ReportReaction { get; set; } = ":triangular_flag_on_post:"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,52 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Hammer.Configuration; | ||
|
||
/// <summary> | ||
/// Represents a role configuration. | ||
/// </summary> | ||
[SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Local", Justification = "Immutability. Setter accessible via DI")] | ||
internal sealed class RoleConfiguration | ||
{ | ||
/// <summary> | ||
/// Gets or sets the Administrator role ID. | ||
/// </summary> | ||
/// <value>The Administrator role ID.</value> | ||
[JsonPropertyName("administratorRoleId")] | ||
public ulong AdministratorRoleId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the role ID of the bot developer. | ||
/// </summary> | ||
/// <value>The bot developer role ID.</value> | ||
[JsonPropertyName("developerRoleId")] | ||
public ulong DeveloperRoleId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the Guru role ID. | ||
/// </summary> | ||
/// <value>The Guru role ID.</value> | ||
[JsonPropertyName("guruRoleId")] | ||
public ulong GuruRoleId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the Moderator role ID. | ||
/// </summary> | ||
/// <value>The Moderator role ID.</value> | ||
[JsonPropertyName("moderatorRoleId")] | ||
public ulong ModeratorRoleId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the Muted role ID. | ||
/// </summary> | ||
/// <value>The Muted role ID.</value> | ||
[JsonPropertyName("mutedRoleId")] | ||
public ulong MutedRoleId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the Staff role ID. | ||
/// </summary> | ||
/// <value>The Staff role ID.</value> | ||
/// <remarks>This is the role that should be applied to both Administrator and Moderator.</remarks> | ||
[JsonPropertyName("staffRoleId")] | ||
public ulong StaffRoleId { get; set; } | ||
} |