* Remove obsolete methods and properties * Remove rest of GuildEmbed * Remove TokenType.User * Changes regarding the removal of the user tokentypetags/3.0.0
| @@ -1,21 +0,0 @@ | |||||
| namespace Discord | |||||
| { | |||||
| /// <summary> | |||||
| /// Provides properties that are used to modify the widget of an <see cref="IGuild" /> with the specified changes. | |||||
| /// </summary> | |||||
| public class GuildEmbedProperties | |||||
| { | |||||
| /// <summary> | |||||
| /// Sets whether the widget should be enabled. | |||||
| /// </summary> | |||||
| public Optional<bool> Enabled { get; set; } | |||||
| /// <summary> | |||||
| /// Sets the channel that the invite should place its users in, if not <c>null</c>. | |||||
| /// </summary> | |||||
| public Optional<IChannel> Channel { get; set; } | |||||
| /// <summary> | |||||
| /// Sets the channel the invite should place its users in, if not <c>null</c>. | |||||
| /// </summary> | |||||
| public Optional<ulong?> ChannelId { get; set; } | |||||
| } | |||||
| } | |||||
| @@ -125,21 +125,6 @@ namespace Discord | |||||
| /// </returns> | /// </returns> | ||||
| ulong? AFKChannelId { get; } | ulong? AFKChannelId { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the ID of the default channel for this guild. | |||||
| /// </summary> | |||||
| /// <remarks> | |||||
| /// This property retrieves the snowflake identifier of the first viewable text channel for this guild. | |||||
| /// <note type="warning"> | |||||
| /// This channel does not guarantee the user can send message to it, as it only looks for the first viewable | |||||
| /// text channel. | |||||
| /// </note> | |||||
| /// </remarks> | |||||
| /// <returns> | |||||
| /// A <see langword="ulong"/> representing the snowflake identifier of the default text channel; <c>0</c> if | |||||
| /// none can be found. | |||||
| /// </returns> | |||||
| ulong DefaultChannelId { get; } | |||||
| /// <summary> | |||||
| /// Gets the ID of the channel assigned to the widget of this guild. | /// Gets the ID of the channel assigned to the widget of this guild. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| @@ -16,14 +16,6 @@ namespace Discord | |||||
| /// </returns> | /// </returns> | ||||
| bool IsTemporary { get; } | bool IsTemporary { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets a value that indicates whether the invite has been revoked. | |||||
| /// </summary> | |||||
| /// <returns> | |||||
| /// <c>true</c> if this invite was revoked; otherwise <c>false</c>. | |||||
| /// </returns> | |||||
| [Obsolete("This property doesn't exist anymore and shouldn't be used.")] | |||||
| bool IsRevoked { get; } | |||||
| /// <summary> | |||||
| /// Gets the time (in seconds) until the invite expires. | /// Gets the time (in seconds) until the invite expires. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <returns> | ||||
| @@ -22,11 +22,6 @@ namespace Discord | |||||
| /// </summary> | /// </summary> | ||||
| AddReactions = 0x00_00_00_40, | AddReactions = 0x00_00_00_40, | ||||
| /// <summary> | /// <summary> | ||||
| /// Allows for reading of messages. This flag is obsolete, use <see cref = "ViewChannel" /> instead. | |||||
| /// </summary> | |||||
| [Obsolete("Use ViewChannel instead.")] | |||||
| ReadMessages = ViewChannel, | |||||
| /// <summary> | |||||
| /// Allows guild members to view a channel, which includes reading messages in text channels. | /// Allows guild members to view a channel, which includes reading messages in text channels. | ||||
| /// </summary> | /// </summary> | ||||
| ViewChannel = 0x00_00_04_00, | ViewChannel = 0x00_00_04_00, | ||||
| @@ -45,9 +45,6 @@ namespace Discord | |||||
| /// <summary> If <c>true</c>, a user may add reactions. </summary> | /// <summary> If <c>true</c>, a user may add reactions. </summary> | ||||
| public bool AddReactions => Permissions.GetValue(RawValue, ChannelPermission.AddReactions); | public bool AddReactions => Permissions.GetValue(RawValue, ChannelPermission.AddReactions); | ||||
| /// <summary> If <c>true</c>, a user may join channels. </summary> | |||||
| [Obsolete("Use ViewChannel instead.")] | |||||
| public bool ReadMessages => ViewChannel; | |||||
| /// <summary> If <c>true</c>, a user may view channels. </summary> | /// <summary> If <c>true</c>, a user may view channels. </summary> | ||||
| public bool ViewChannel => Permissions.GetValue(RawValue, ChannelPermission.ViewChannel); | public bool ViewChannel => Permissions.GetValue(RawValue, ChannelPermission.ViewChannel); | ||||
| @@ -65,8 +65,6 @@ namespace Discord | |||||
| /// Allows for viewing of audit logs. | /// Allows for viewing of audit logs. | ||||
| /// </summary> | /// </summary> | ||||
| ViewAuditLog = 0x00_00_00_80, | ViewAuditLog = 0x00_00_00_80, | ||||
| [Obsolete("Use ViewChannel instead.")] | |||||
| ReadMessages = ViewChannel, | |||||
| ViewChannel = 0x00_00_04_00, | ViewChannel = 0x00_00_04_00, | ||||
| SendMessages = 0x00_00_08_00, | SendMessages = 0x00_00_08_00, | ||||
| /// <summary> | /// <summary> | ||||
| @@ -37,9 +37,6 @@ namespace Discord | |||||
| /// <summary> If <c>true</c>, a user may view the guild insights. </summary> | /// <summary> If <c>true</c>, a user may view the guild insights. </summary> | ||||
| public bool ViewGuildInsights => Permissions.GetValue(RawValue, GuildPermission.ViewGuildInsights); | public bool ViewGuildInsights => Permissions.GetValue(RawValue, GuildPermission.ViewGuildInsights); | ||||
| /// <summary> If True, a user may join channels. </summary> | |||||
| [Obsolete("Use ViewChannel instead.")] | |||||
| public bool ReadMessages => ViewChannel; | |||||
| /// <summary> If True, a user may view channels. </summary> | /// <summary> If True, a user may view channels. </summary> | ||||
| public bool ViewChannel => Permissions.GetValue(RawValue, GuildPermission.ViewChannel); | public bool ViewChannel => Permissions.GetValue(RawValue, GuildPermission.ViewChannel); | ||||
| /// <summary> If True, a user may send messages. </summary> | /// <summary> If True, a user may send messages. </summary> | ||||
| @@ -43,9 +43,6 @@ namespace Discord | |||||
| /// <summary> If Allowed, a user may add reactions. </summary> | /// <summary> If Allowed, a user may add reactions. </summary> | ||||
| public PermValue AddReactions => Permissions.GetValue(AllowValue, DenyValue, ChannelPermission.AddReactions); | public PermValue AddReactions => Permissions.GetValue(AllowValue, DenyValue, ChannelPermission.AddReactions); | ||||
| /// <summary> If Allowed, a user may join channels. </summary> | /// <summary> If Allowed, a user may join channels. </summary> | ||||
| [Obsolete("Use ViewChannel instead.")] | |||||
| public PermValue ReadMessages => ViewChannel; | |||||
| /// <summary> If Allowed, a user may join channels. </summary> | |||||
| public PermValue ViewChannel => Permissions.GetValue(AllowValue, DenyValue, ChannelPermission.ViewChannel); | public PermValue ViewChannel => Permissions.GetValue(AllowValue, DenyValue, ChannelPermission.ViewChannel); | ||||
| /// <summary> If Allowed, a user may send messages. </summary> | /// <summary> If Allowed, a user may send messages. </summary> | ||||
| public PermValue SendMessages => Permissions.GetValue(AllowValue, DenyValue, ChannelPermission.SendMessages); | public PermValue SendMessages => Permissions.GetValue(AllowValue, DenyValue, ChannelPermission.SendMessages); | ||||
| @@ -22,12 +22,6 @@ namespace Discord | |||||
| /// </summary> | /// </summary> | ||||
| HypeSquadEvents = 1 << 2, | HypeSquadEvents = 1 << 2, | ||||
| /// <summary> | /// <summary> | ||||
| /// Flag given to users who have participated in the bug report program. | |||||
| /// This flag is obsolete, use <see cref="BugHunterLevel1"/> instead. | |||||
| /// </summary> | |||||
| [Obsolete("Use BugHunterLevel1 instead.")] | |||||
| BugHunter = 1 << 3, | |||||
| /// <summary> | |||||
| /// Flag given to users who have participated in the bug report program and are level 1. | /// Flag given to users who have participated in the bug report program and are level 1. | ||||
| /// </summary> | /// </summary> | ||||
| BugHunterLevel1 = 1 << 3, | BugHunterLevel1 = 1 << 3, | ||||
| @@ -5,8 +5,6 @@ namespace Discord | |||||
| /// <summary> Specifies the type of token to use with the client. </summary> | /// <summary> Specifies the type of token to use with the client. </summary> | ||||
| public enum TokenType | public enum TokenType | ||||
| { | { | ||||
| [Obsolete("User logins are deprecated and may result in a ToS strike against your account - please see https://github.com/RogueException/Discord.Net/issues/827", error: true)] | |||||
| User, | |||||
| /// <summary> | /// <summary> | ||||
| /// An OAuth2 token type. | /// An OAuth2 token type. | ||||
| /// </summary> | /// </summary> | ||||
| @@ -79,7 +79,6 @@ namespace Discord.API | |||||
| { | { | ||||
| return tokenType switch | return tokenType switch | ||||
| { | { | ||||
| default(TokenType) => token, | |||||
| TokenType.Bot => $"Bot {token}", | TokenType.Bot => $"Bot {token}", | ||||
| TokenType.Bearer => $"Bearer {token}", | TokenType.Bearer => $"Bearer {token}", | ||||
| _ => throw new ArgumentException(message: "Unknown OAuth token type.", paramName: nameof(tokenType)), | _ => throw new ArgumentException(message: "Unknown OAuth token type.", paramName: nameof(tokenType)), | ||||
| @@ -90,8 +90,6 @@ namespace Discord.Rest | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id); | public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id); | ||||
| [Obsolete("DefaultChannelId is deprecated, use GetDefaultChannelAsync")] | |||||
| public ulong DefaultChannelId => Id; | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public string IconUrl => CDN.GetGuildIconUrl(Id, IconId); | public string IconUrl => CDN.GetGuildIconUrl(Id, IconId); | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| @@ -8,9 +8,6 @@ namespace Discord.Rest | |||||
| { | { | ||||
| private long _createdAtTicks; | private long _createdAtTicks; | ||||
| /// <inheritdoc /> | |||||
| [Obsolete("This property doesn't exist anymore and shouldn't be used.")] | |||||
| public bool IsRevoked { get; private set; } | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public bool IsTemporary { get; private set; } | public bool IsTemporary { get; private set; } | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| @@ -1205,8 +1205,6 @@ namespace Discord.WebSocket | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| bool IGuild.Available => true; | bool IGuild.Available => true; | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| ulong IGuild.DefaultChannelId => DefaultChannel?.Id ?? 0; | |||||
| /// <inheritdoc /> | |||||
| ulong? IGuild.WidgetChannelId => WidgetChannelId; | ulong? IGuild.WidgetChannelId => WidgetChannelId; | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| ulong? IGuild.SystemChannelId => SystemChannelId; | ulong? IGuild.SystemChannelId => SystemChannelId; | ||||
| @@ -49,9 +49,6 @@ namespace Discord.WebSocket | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| int? IInvite.MemberCount => throw new NotImplementedException(); | int? IInvite.MemberCount => throw new NotImplementedException(); | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| [Obsolete("This property doesn't exist anymore and shouldn't be used.")] | |||||
| bool IInviteMetadata.IsRevoked => throw new NotImplementedException(); | |||||
| /// <inheritdoc /> | |||||
| public bool IsTemporary { get; private set; } | public bool IsTemporary { get; private set; } | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| int? IInviteMetadata.MaxAge { get => MaxAge; } | int? IInviteMetadata.MaxAge { get => MaxAge; } | ||||
| @@ -127,8 +127,6 @@ namespace Discord | |||||
| /// The <see cref="TokenType.User"/> type is treated as an invalid <see cref="TokenType"/>. | /// The <see cref="TokenType.User"/> type is treated as an invalid <see cref="TokenType"/>. | ||||
| /// </remarks> | /// </remarks> | ||||
| [Theory] | [Theory] | ||||
| // TokenType.User | |||||
| [InlineData(0)] | |||||
| // out of range TokenType | // out of range TokenType | ||||
| [InlineData(-1)] | [InlineData(-1)] | ||||
| [InlineData(4)] | [InlineData(4)] | ||||