Browse Source

fix: Remove obsolete methods and properties (#1849)

* Remove obsolete methods and properties

* Remove rest of GuildEmbed

* Remove TokenType.User

* Changes regarding the removal of the user tokentype
tags/3.0.0
Paulo GitHub 4 years ago
parent
commit
70aab6c4f6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 0 additions and 81 deletions
  1. +0
    -21
      src/Discord.Net.Core/Entities/Guilds/GuildEmbedProperties.cs
  2. +0
    -15
      src/Discord.Net.Core/Entities/Guilds/IGuild.cs
  3. +0
    -8
      src/Discord.Net.Core/Entities/Invites/IInviteMetadata.cs
  4. +0
    -5
      src/Discord.Net.Core/Entities/Permissions/ChannelPermission.cs
  5. +0
    -3
      src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs
  6. +0
    -2
      src/Discord.Net.Core/Entities/Permissions/GuildPermission.cs
  7. +0
    -3
      src/Discord.Net.Core/Entities/Permissions/GuildPermissions.cs
  8. +0
    -3
      src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs
  9. +0
    -6
      src/Discord.Net.Core/Entities/Users/UserProperties.cs
  10. +0
    -2
      src/Discord.Net.Core/TokenType.cs
  11. +0
    -1
      src/Discord.Net.Rest/DiscordRestApiClient.cs
  12. +0
    -2
      src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs
  13. +0
    -3
      src/Discord.Net.Rest/Entities/Invites/RestInviteMetadata.cs
  14. +0
    -2
      src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs
  15. +0
    -3
      src/Discord.Net.WebSocket/Entities/Invites/SocketInvite.cs
  16. +0
    -2
      test/Discord.Net.Tests.Unit/TokenUtilsTests.cs

+ 0
- 21
src/Discord.Net.Core/Entities/Guilds/GuildEmbedProperties.cs View File

@@ -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; }
}
}

+ 0
- 15
src/Discord.Net.Core/Entities/Guilds/IGuild.cs View File

@@ -125,21 +125,6 @@ namespace Discord
/// </returns>
ulong? AFKChannelId { get; }
/// <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.
/// </summary>
/// <returns>


+ 0
- 8
src/Discord.Net.Core/Entities/Invites/IInviteMetadata.cs View File

@@ -16,14 +16,6 @@ namespace Discord
/// </returns>
bool IsTemporary { get; }
/// <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.
/// </summary>
/// <returns>


+ 0
- 5
src/Discord.Net.Core/Entities/Permissions/ChannelPermission.cs View File

@@ -22,11 +22,6 @@ namespace Discord
/// </summary>
AddReactions = 0x00_00_00_40,
/// <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.
/// </summary>
ViewChannel = 0x00_00_04_00,


+ 0
- 3
src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs View File

@@ -45,9 +45,6 @@ namespace Discord

/// <summary> If <c>true</c>, a user may add reactions. </summary>
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>
public bool ViewChannel => Permissions.GetValue(RawValue, ChannelPermission.ViewChannel);



+ 0
- 2
src/Discord.Net.Core/Entities/Permissions/GuildPermission.cs View File

@@ -65,8 +65,6 @@ namespace Discord
/// Allows for viewing of audit logs.
/// </summary>
ViewAuditLog = 0x00_00_00_80,
[Obsolete("Use ViewChannel instead.")]
ReadMessages = ViewChannel,
ViewChannel = 0x00_00_04_00,
SendMessages = 0x00_00_08_00,
/// <summary>


+ 0
- 3
src/Discord.Net.Core/Entities/Permissions/GuildPermissions.cs View File

@@ -37,9 +37,6 @@ namespace Discord
/// <summary> If <c>true</c>, a user may view the guild insights. </summary>
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>
public bool ViewChannel => Permissions.GetValue(RawValue, GuildPermission.ViewChannel);
/// <summary> If True, a user may send messages. </summary>


+ 0
- 3
src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs View File

@@ -43,9 +43,6 @@ namespace Discord
/// <summary> If Allowed, a user may add reactions. </summary>
public PermValue AddReactions => Permissions.GetValue(AllowValue, DenyValue, ChannelPermission.AddReactions);
/// <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);
/// <summary> If Allowed, a user may send messages. </summary>
public PermValue SendMessages => Permissions.GetValue(AllowValue, DenyValue, ChannelPermission.SendMessages);


+ 0
- 6
src/Discord.Net.Core/Entities/Users/UserProperties.cs View File

@@ -22,12 +22,6 @@ namespace Discord
/// </summary>
HypeSquadEvents = 1 << 2,
/// <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.
/// </summary>
BugHunterLevel1 = 1 << 3,


+ 0
- 2
src/Discord.Net.Core/TokenType.cs View File

@@ -5,8 +5,6 @@ namespace Discord
/// <summary> Specifies the type of token to use with the client. </summary>
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>
/// An OAuth2 token type.
/// </summary>


+ 0
- 1
src/Discord.Net.Rest/DiscordRestApiClient.cs View File

@@ -79,7 +79,6 @@ namespace Discord.API
{
return tokenType switch
{
default(TokenType) => token,
TokenType.Bot => $"Bot {token}",
TokenType.Bearer => $"Bearer {token}",
_ => throw new ArgumentException(message: "Unknown OAuth token type.", paramName: nameof(tokenType)),


+ 0
- 2
src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs View File

@@ -90,8 +90,6 @@ namespace Discord.Rest
/// <inheritdoc />
public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id);

[Obsolete("DefaultChannelId is deprecated, use GetDefaultChannelAsync")]
public ulong DefaultChannelId => Id;
/// <inheritdoc />
public string IconUrl => CDN.GetGuildIconUrl(Id, IconId);
/// <inheritdoc />


+ 0
- 3
src/Discord.Net.Rest/Entities/Invites/RestInviteMetadata.cs View File

@@ -8,9 +8,6 @@ namespace Discord.Rest
{
private long _createdAtTicks;

/// <inheritdoc />
[Obsolete("This property doesn't exist anymore and shouldn't be used.")]
public bool IsRevoked { get; private set; }
/// <inheritdoc />
public bool IsTemporary { get; private set; }
/// <inheritdoc />


+ 0
- 2
src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs View File

@@ -1205,8 +1205,6 @@ namespace Discord.WebSocket
/// <inheritdoc />
bool IGuild.Available => true;
/// <inheritdoc />
ulong IGuild.DefaultChannelId => DefaultChannel?.Id ?? 0;
/// <inheritdoc />
ulong? IGuild.WidgetChannelId => WidgetChannelId;
/// <inheritdoc />
ulong? IGuild.SystemChannelId => SystemChannelId;


+ 0
- 3
src/Discord.Net.WebSocket/Entities/Invites/SocketInvite.cs View File

@@ -49,9 +49,6 @@ namespace Discord.WebSocket
/// <inheritdoc />
int? IInvite.MemberCount => throw new NotImplementedException();
/// <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; }
/// <inheritdoc />
int? IInviteMetadata.MaxAge { get => MaxAge; }


+ 0
- 2
test/Discord.Net.Tests.Unit/TokenUtilsTests.cs View File

@@ -127,8 +127,6 @@ namespace Discord
/// The <see cref="TokenType.User"/> type is treated as an invalid <see cref="TokenType"/>.
/// </remarks>
[Theory]
// TokenType.User
[InlineData(0)]
// out of range TokenType
[InlineData(-1)]
[InlineData(4)]


Loading…
Cancel
Save