[Feature] New discord features (#2649)

This commit is contained in:
Misha133
2023-03-31 14:13:58 +03:00
committed by GitHub
parent 9ccd9cf75b
commit 2112e1f5b6
12 changed files with 154 additions and 5 deletions

View File

@@ -93,6 +93,7 @@ namespace Discord.WebSocket
internal ulong? AFKChannelId { get; private set; }
internal ulong? WidgetChannelId { get; private set; }
internal ulong? SafetyAlertsChannelId { get; private set; }
internal ulong? SystemChannelId { get; private set; }
internal ulong? RulesChannelId { get; private set; }
internal ulong? PublicUpdatesChannelId { get; private set; }
@@ -220,6 +221,22 @@ namespace Discord.WebSocket
return id.HasValue ? GetChannel(id.Value) : null;
}
}
/// <summary>
/// Gets the safety alerts channel in this guild.
/// </summary>
/// <returns>
/// The channel set for receiving safety alerts channel; <see langword="null"/> if none is set.
/// </returns>
public SocketGuildChannel SafetyAlertsChannel
{
get
{
var id = SafetyAlertsChannelId;
return id.HasValue ? GetChannel(id.Value) : null;
}
}
/// <summary>
/// Gets the system channel where randomized welcome messages are sent in this guild.
/// </summary>
@@ -498,6 +515,8 @@ namespace Discord.WebSocket
AFKChannelId = model.AFKChannelId;
if (model.WidgetChannelId.IsSpecified)
WidgetChannelId = model.WidgetChannelId.Value;
if (model.SafetyAlertsChannelId.IsSpecified)
SafetyAlertsChannelId = model.SafetyAlertsChannelId.Value;
SystemChannelId = model.SystemChannelId;
RulesChannelId = model.RulesChannelId;
PublicUpdatesChannelId = model.PublicUpdatesChannelId;
@@ -1894,6 +1913,8 @@ namespace Discord.WebSocket
/// <inheritdoc />
ulong? IGuild.WidgetChannelId => WidgetChannelId;
/// <inheritdoc />
ulong? IGuild.SafetyAlertsChannelId => SafetyAlertsChannelId;
/// <inheritdoc />
ulong? IGuild.SystemChannelId => SystemChannelId;
/// <inheritdoc />
ulong? IGuild.RulesChannelId => RulesChannelId;