-
-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Guild incident actions (#2783)
* initial commit * <see langword="null"/> notes
- Loading branch information
Showing
10 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/Discord.Net.Core/Entities/Guilds/GuildIncidentsData.cs
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
|
||
namespace Discord; | ||
|
||
public class GuildIncidentsData | ||
{ | ||
/// <summary> | ||
/// Gets the time when invites get enabled again. <see langword="null"/> if invites are not disabled. | ||
/// </summary> | ||
public DateTimeOffset? InvitesDisabledUntil { get; set; } | ||
|
||
/// <summary> | ||
/// Gets the time when DMs get enabled again. <see langword="null"/> if DMs are not disabled. | ||
/// </summary> | ||
public DateTimeOffset? DmsDisabledUntil { get; set; } | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Discord.Net.Core/Entities/Guilds/GuildIncidentsDataProperties.cs
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
|
||
namespace Discord; | ||
|
||
public class GuildIncidentsDataProperties | ||
{ | ||
/// <summary> | ||
/// Gets or set when invites get enabled again, up to 24 hours in the future. | ||
/// </summary> | ||
/// <remarks> | ||
/// Set to <see langword="null"/> to enable invites. | ||
/// </remarks> | ||
public Optional<DateTimeOffset?> InvitesDisabledUntil { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or set when dms get enabled again, up to 24 hours in the future. | ||
/// </summary> | ||
/// <remarks> | ||
/// Set to <see langword="null"/> to enable dms. | ||
/// </remarks> | ||
public Optional<DateTimeOffset?> DmsDisabledUntil { 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
|
||
namespace Discord.API; | ||
|
||
internal class GuildIncidentsData | ||
{ | ||
[JsonProperty("invites_disabled_until")] | ||
public DateTimeOffset? InvitesDisabledUntil { get; set; } | ||
|
||
[JsonProperty("dms_disabled_until")] | ||
public DateTimeOffset? DmsDisabledUntil { get; set; } | ||
} |
13 changes: 13 additions & 0 deletions
13
src/Discord.Net.Rest/API/Rest/ModifyGuildIncidentsDataParams.cs
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
|
||
namespace Discord.API.Rest; | ||
|
||
internal class ModifyGuildIncidentsDataParams | ||
{ | ||
[JsonProperty("invites_disabled_until")] | ||
public Optional<DateTimeOffset?> InvitesDisabledUntil { get; set; } | ||
|
||
[JsonProperty("dms_disabled_until")] | ||
public Optional<DateTimeOffset?> DmsDisabledUntil { 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
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