Visitar URL original
remove deprecated code, attempt 2 by inftord · Pull Request #1616 · DSharpPlus/DSharpPlus · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions DSharpPlus.Interactivity/InteractivityConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,7 @@ public sealed class InteractivityConfiguration
/// Buttons to use for pagination.
/// </summary>
public PaginationButtons PaginationButtons { internal get; set; } = new();

/// <summary>
/// Whether interactivity should ACK buttons that are pushed. Setting this to <see langword="true"/> will also prevent subsequent event handlers from running.
/// </summary>
[Obsolete("This setting is no longer used or possible to implement.", false)]
public bool AckPaginationButtons { internal get; set; }


/// <summary>
/// How to handle buttons after pagination ends.
/// </summary>
Expand Down
12 changes: 1 addition & 11 deletions DSharpPlus.Rest/DiscordRestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1229,17 +1229,7 @@ await this.ApiClient.ModifyGuildMemberAsync(guild_id, member_id, mdl.Nickname,
mdl.VoiceChannel.IfPresent(e => e?.Id), mdl.CommunicationDisabledUntil, mdl.AuditLogReason);
}
}

/// <summary>
/// Changes current user's nickname
/// </summary>
/// <param name="guild_id">Guild ID</param>
/// <param name="nick">Nickname</param>
/// <param name="reason">Reason why you set it to this</param>
/// <returns></returns>
[Obsolete("This method is depreciated and will be removed in a future version. Please use ModifyCurrentMemberAsync instead.", false)]
public Task ModifyCurrentMemberNicknameAsync(ulong guild_id, string nick, string reason)
=> this.ApiClient.ModifyCurrentMemberAsync(guild_id, nick, reason);


/// <summary>
/// Changes the current user in a guild.
Expand Down
8 changes: 2 additions & 6 deletions DSharpPlus/Clients/DiscordClient.WebSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ internal async Task SendRawPayloadAsync(string jsonPayload)
await this._webSocketClient.SendMessageAsync(jsonPayload);
}

#nullable enable
/// <summary>
/// Sends a raw payload to the gateway. This method is not recommended for use unless you know what you're doing.
/// </summary>
Expand All @@ -518,21 +517,18 @@ internal async Task SendRawPayloadAsync(string jsonPayload)
public Task SendPayloadAsync<T>(GatewayOpCode opCode, T data) => this.SendPayloadAsync(opCode, (object?)data);

/// <inheritdoc cref="SendPayloadAsync{T}(GatewayOpCode, T)"/>
/// <param name="data">The data to deserialize.</param>
/// <param name="opCode">The opcode to send to the Discord gateway.</param>
[Obsolete("This method should not be used unless you know what you're doing. Instead, look towards the other explicitly implemented methods which come with client-side validation.")]
public Task SendPayloadAsync(GatewayOpCode opCode, object? data = null)
{
var payload = new GatewayPayload
GatewayPayload payload = new()
{
OpCode = opCode,
Data = data
};

var payloadString = DiscordJson.SerializeObject(payload);
string payloadString = DiscordJson.SerializeObject(payload);
return this.SendRawPayloadAsync(payloadString);
}
#nullable disable
#endregion

#region Semaphore Methods
Expand Down
8 changes: 0 additions & 8 deletions DSharpPlus/Entities/Invite/DiscordInvite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@ public class DiscordInvite
/// </summary>
[JsonProperty("target_application", NullValueHandling = NullValueHandling.Ignore)]
public DiscordApplication TargetApplication { get; internal set; }

/// <summary>
/// Gets the type of user who the invite is for.
/// </summary>
[Obsolete("This property is depreciated and will be removed in a future version. Please use TargetType instead.", false)]
[JsonProperty("target_user_type", NullValueHandling = NullValueHandling.Ignore)]
public TargetUserType? TargetUserType { get; internal set; }

/// <summary>
/// Gets the target application for this invite.
/// </summary>
Expand Down
8 changes: 0 additions & 8 deletions DSharpPlus/Enums/Channel/ChannelType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

using System;

namespace DSharpPlus
{
/// <summary>
Expand Down Expand Up @@ -60,12 +58,6 @@ public enum ChannelType : int
/// </summary>
News = 5,

/// <summary>
/// Indicates that this is a store channel.
/// </summary>
[Obsolete("Store channels have been sunset.", true)]
Store = 6,

/// <summary>
/// Indicates that this is a thread within a news channel.
/// </summary>
Expand Down
21 changes: 0 additions & 21 deletions DSharpPlus/Enums/Permission.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,6 @@ public enum Permissions : long
[PermissionString("Allow stream")]
Stream = 0x0000000000000200,

/// <summary>
/// Allows the user to use slash commands.
/// </summary>
[Obsolete("Replaced by UseApplicationCommands", false)]
[PermissionString("Use slash commands")]
UseSlashCommands = 0x0000000080000000,

/// <summary>
/// Allows the user to use application commands.
/// </summary>
Expand All @@ -305,20 +298,6 @@ public enum Permissions : long
[PermissionString("Manage Threads")]
ManageThreads = 0x0000000400000000,

/// <summary>
/// Allows for creating and participating in threads.
/// </summary>
[Obsolete("Replaced by CreatePublicThreads and SendMessagesInThreads", false)]
[PermissionString("Use Public Threads")]
UsePublicThreads = 0x0000000800000000,

/// <summary>
/// Allows for creating and participating in private threads.
/// </summary>
[Obsolete("Replaced by CreatePrivateThreads and SendMessagesInThreads", false)]
[PermissionString("Use Private Threads")]
UsePrivateThreads = 0x0000001000000000,

/// <summary>
/// Allows for creating public threads.
/// </summary>
Expand Down
9 changes: 0 additions & 9 deletions DSharpPlus/Enums/TokenType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,13 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

using System;

namespace DSharpPlus
{
/// <summary>
/// Token type
/// </summary>
public enum TokenType
{
/// <summary>
/// User token type
/// </summary>
[Obsolete("Logging in with a user token may result in your account being terminated, and is therefore highly unrecommended." +
"\nIf anything goes wrong with this, we will not provide any support!", true)]
User = 0,

/// <summary>
/// Bot token type
/// </summary>
Expand Down
36 changes: 0 additions & 36 deletions DSharpPlus/Enums/User/TargetUserType.cs

This file was deleted.