Skip to content

Commit 6b0e24a

Browse files
authored
remove deprecated code, attempt 2 (#1616)
* remove deprecated code, attempt 2 * get sendpayloadasync methods back
1 parent 41c827b commit 6b0e24a

File tree

8 files changed

+4
-106
lines changed

8 files changed

+4
-106
lines changed

DSharpPlus.Interactivity/InteractivityConfiguration.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,7 @@ public sealed class InteractivityConfiguration
5252
/// Buttons to use for pagination.
5353
/// </summary>
5454
public PaginationButtons PaginationButtons { internal get; set; } = new();
55-
56-
/// <summary>
57-
/// Whether interactivity should ACK buttons that are pushed. Setting this to <see langword="true"/> will also prevent subsequent event handlers from running.
58-
/// </summary>
59-
[Obsolete("This setting is no longer used or possible to implement.", false)]
60-
public bool AckPaginationButtons { internal get; set; }
61-
55+
6256
/// <summary>
6357
/// How to handle buttons after pagination ends.
6458
/// </summary>

DSharpPlus.Rest/DiscordRestClient.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,17 +1229,7 @@ await this.ApiClient.ModifyGuildMemberAsync(guild_id, member_id, mdl.Nickname,
12291229
mdl.VoiceChannel.IfPresent(e => e?.Id), mdl.CommunicationDisabledUntil, mdl.AuditLogReason);
12301230
}
12311231
}
1232-
1233-
/// <summary>
1234-
/// Changes current user's nickname
1235-
/// </summary>
1236-
/// <param name="guild_id">Guild ID</param>
1237-
/// <param name="nick">Nickname</param>
1238-
/// <param name="reason">Reason why you set it to this</param>
1239-
/// <returns></returns>
1240-
[Obsolete("This method is depreciated and will be removed in a future version. Please use ModifyCurrentMemberAsync instead.", false)]
1241-
public Task ModifyCurrentMemberNicknameAsync(ulong guild_id, string nick, string reason)
1242-
=> this.ApiClient.ModifyCurrentMemberAsync(guild_id, nick, reason);
1232+
12431233

12441234
/// <summary>
12451235
/// Changes the current user in a guild.

DSharpPlus/Clients/DiscordClient.WebSocket.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,6 @@ internal async Task SendRawPayloadAsync(string jsonPayload)
506506
await this._webSocketClient.SendMessageAsync(jsonPayload);
507507
}
508508

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

520519
/// <inheritdoc cref="SendPayloadAsync{T}(GatewayOpCode, T)"/>
521-
/// <param name="data">The data to deserialize.</param>
522-
/// <param name="opCode">The opcode to send to the Discord gateway.</param>
523520
[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.")]
524521
public Task SendPayloadAsync(GatewayOpCode opCode, object? data = null)
525522
{
526-
var payload = new GatewayPayload
523+
GatewayPayload payload = new()
527524
{
528525
OpCode = opCode,
529526
Data = data
530527
};
531528

532-
var payloadString = DiscordJson.SerializeObject(payload);
529+
string payloadString = DiscordJson.SerializeObject(payload);
533530
return this.SendRawPayloadAsync(payloadString);
534531
}
535-
#nullable disable
536532
#endregion
537533

538534
#region Semaphore Methods

DSharpPlus/Entities/Invite/DiscordInvite.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,6 @@ public class DiscordInvite
6464
/// </summary>
6565
[JsonProperty("target_application", NullValueHandling = NullValueHandling.Ignore)]
6666
public DiscordApplication TargetApplication { get; internal set; }
67-
68-
/// <summary>
69-
/// Gets the type of user who the invite is for.
70-
/// </summary>
71-
[Obsolete("This property is depreciated and will be removed in a future version. Please use TargetType instead.", false)]
72-
[JsonProperty("target_user_type", NullValueHandling = NullValueHandling.Ignore)]
73-
public TargetUserType? TargetUserType { get; internal set; }
74-
7567
/// <summary>
7668
/// Gets the target application for this invite.
7769
/// </summary>

DSharpPlus/Enums/Channel/ChannelType.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
// SOFTWARE.
2323

24-
using System;
25-
2624
namespace DSharpPlus
2725
{
2826
/// <summary>
@@ -60,12 +58,6 @@ public enum ChannelType : int
6058
/// </summary>
6159
News = 5,
6260

63-
/// <summary>
64-
/// Indicates that this is a store channel.
65-
/// </summary>
66-
[Obsolete("Store channels have been sunset.", true)]
67-
Store = 6,
68-
6961
/// <summary>
7062
/// Indicates that this is a thread within a news channel.
7163
/// </summary>

DSharpPlus/Enums/Permission.cs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,6 @@ public enum Permissions : long
274274
[PermissionString("Allow stream")]
275275
Stream = 0x0000000000000200,
276276

277-
/// <summary>
278-
/// Allows the user to use slash commands.
279-
/// </summary>
280-
[Obsolete("Replaced by UseApplicationCommands", false)]
281-
[PermissionString("Use slash commands")]
282-
UseSlashCommands = 0x0000000080000000,
283-
284277
/// <summary>
285278
/// Allows the user to use application commands.
286279
/// </summary>
@@ -305,20 +298,6 @@ public enum Permissions : long
305298
[PermissionString("Manage Threads")]
306299
ManageThreads = 0x0000000400000000,
307300

308-
/// <summary>
309-
/// Allows for creating and participating in threads.
310-
/// </summary>
311-
[Obsolete("Replaced by CreatePublicThreads and SendMessagesInThreads", false)]
312-
[PermissionString("Use Public Threads")]
313-
UsePublicThreads = 0x0000000800000000,
314-
315-
/// <summary>
316-
/// Allows for creating and participating in private threads.
317-
/// </summary>
318-
[Obsolete("Replaced by CreatePrivateThreads and SendMessagesInThreads", false)]
319-
[PermissionString("Use Private Threads")]
320-
UsePrivateThreads = 0x0000001000000000,
321-
322301
/// <summary>
323302
/// Allows for creating public threads.
324303
/// </summary>

DSharpPlus/Enums/TokenType.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,13 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
// SOFTWARE.
2323

24-
using System;
25-
2624
namespace DSharpPlus
2725
{
2826
/// <summary>
2927
/// Token type
3028
/// </summary>
3129
public enum TokenType
3230
{
33-
/// <summary>
34-
/// User token type
35-
/// </summary>
36-
[Obsolete("Logging in with a user token may result in your account being terminated, and is therefore highly unrecommended." +
37-
"\nIf anything goes wrong with this, we will not provide any support!", true)]
38-
User = 0,
39-
4031
/// <summary>
4132
/// Bot token type
4233
/// </summary>

DSharpPlus/Enums/User/TargetUserType.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)