Update Guild and Message Models (#1165)
* Add ExplicitContentFilter property to Guild * re-order properties to match order listed on api docs * re-order SystemChannelId to match api docs * Implement ApplicationId in Guild model * Add ExplicitContentFilter property to Guild * re-order properties to match order listed on api docs * re-order SystemChannelId to match api docs * Implement ApplicationId in Guild model * Improve xmldoc for IGuild ExplicitContentFilter * Update xmldoc * docs "Id" -> "ID" * rename Test.GuildPermissions to a more general Test.Guilds * Add ExplicitContentFilter to GuildProperties * Add a test for ExplicitContentFilterLevel modification behavior * Implement ModifyAsync behavior * simplify ExplicitContentFilter test * Add RestGuild ApplicationId inheritdoc * Implement message Activity and Application model update * RestMessage Application and Activity implementation * add ToString to MessageApplication * Add IconUrl property to MessageApplication * clean up whitespace * another excessive whitespace removal
This commit is contained in:
committed by
Christopher F
parent
10f67a8098
commit
d30d12246d
@@ -1,4 +1,4 @@
|
||||
#pragma warning disable CS1591
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API
|
||||
@@ -25,10 +25,12 @@ namespace Discord.API
|
||||
public bool EmbedEnabled { get; set; }
|
||||
[JsonProperty("embed_channel_id")]
|
||||
public ulong? EmbedChannelId { get; set; }
|
||||
[JsonProperty("system_channel_id")]
|
||||
public ulong? SystemChannelId { get; set; }
|
||||
[JsonProperty("verification_level")]
|
||||
public VerificationLevel VerificationLevel { get; set; }
|
||||
[JsonProperty("default_message_notifications")]
|
||||
public DefaultMessageNotifications DefaultMessageNotifications { get; set; }
|
||||
[JsonProperty("explicit_content_filter")]
|
||||
public ExplicitContentFilterLevel ExplicitContentFilter { get; set; }
|
||||
[JsonProperty("voice_states")]
|
||||
public VoiceState[] VoiceStates { get; set; }
|
||||
[JsonProperty("roles")]
|
||||
@@ -39,7 +41,9 @@ namespace Discord.API
|
||||
public string[] Features { get; set; }
|
||||
[JsonProperty("mfa_level")]
|
||||
public MfaLevel MfaLevel { get; set; }
|
||||
[JsonProperty("default_message_notifications")]
|
||||
public DefaultMessageNotifications DefaultMessageNotifications { get; set; }
|
||||
[JsonProperty("application_id")]
|
||||
public ulong? ApplicationId { get; set; }
|
||||
[JsonProperty("system_channel_id")]
|
||||
public ulong? SystemChannelId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,5 +44,11 @@ namespace Discord.API
|
||||
public Optional<bool> Pinned { get; set; }
|
||||
[JsonProperty("reactions")]
|
||||
public Optional<Reaction[]> Reactions { get; set; }
|
||||
// sent with Rich Presence-related chat embeds
|
||||
[JsonProperty("activity")]
|
||||
public Optional<MessageActivity> Activity { get; set; }
|
||||
// sent with Rich Presence-related chat embeds
|
||||
[JsonProperty("application")]
|
||||
public Optional<MessageApplication> Application { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
17
src/Discord.Net.Rest/API/Common/MessageActivity.cs
Normal file
17
src/Discord.Net.Rest/API/Common/MessageActivity.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
public class MessageActivity
|
||||
{
|
||||
[JsonProperty("type")]
|
||||
public Optional<MessageActivityType> Type { get; set; }
|
||||
[JsonProperty("party_id")]
|
||||
public Optional<string> PartyId { get; set; }
|
||||
}
|
||||
}
|
||||
38
src/Discord.Net.Rest/API/Common/MessageApplication.cs
Normal file
38
src/Discord.Net.Rest/API/Common/MessageApplication.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
public class MessageApplication
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the snowflake ID of the application.
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
/// <summary>
|
||||
/// Gets the ID of the embed's image asset.
|
||||
/// </summary>
|
||||
[JsonProperty("cover_image")]
|
||||
public string CoverImage { get; set; }
|
||||
/// <summary>
|
||||
/// Gets the application's description.
|
||||
/// </summary>
|
||||
[JsonProperty("description")]
|
||||
public string Description { get; set; }
|
||||
/// <summary>
|
||||
/// Gets the ID of the application's icon.
|
||||
/// </summary>
|
||||
[JsonProperty("icon")]
|
||||
public string Icon { get; set; }
|
||||
/// <summary>
|
||||
/// Gets the name of the application.
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user