From 86f303aed56ced4f0d0b589a80949d33f2343c10 Mon Sep 17 00:00:00 2001 From: Vic256 Date: Sun, 17 Jul 2022 17:33:57 +0200 Subject: [PATCH] fix: Remove edit method --- lib/src/api/channels/permission_overwrite.dart | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/src/api/channels/permission_overwrite.dart b/lib/src/api/channels/permission_overwrite.dart index b260f00f..e2e7a3c2 100644 --- a/lib/src/api/channels/permission_overwrite.dart +++ b/lib/src/api/channels/permission_overwrite.dart @@ -34,7 +34,7 @@ class PermissionOverwrite { }; } - /// ### Edit [PermissionOverwrite] of a [Channel] + /* /// ### Edit [PermissionOverwrite] of a [Channel] /// /// Example : /// ```dart @@ -42,20 +42,21 @@ class PermissionOverwrite { /// final PermissionOverwrite overwrite = await channel.permissionOverwrites.cache.getOrFail('240561194958716928'); /// /// await overwrite.edit(allow: [Permission.sendMessages], deny: [Permission.banMembers, Permission.attachFiles]); - /// ``` - Future edit ({List? allow, List? deny}) async { - final Http http = ioc.singleton(ioc.services.client); + /// ```*/ + /* Future edit ({List? allow, List? deny}) async { + final Http http = ioc.singleton(ioc.services.http); - final Response response = await http.patch(url: "/channels/$id/permissions/$id", payload: { + final Response response = await http.put(url: "/channels/$channelId/permissions/$id", payload: { 'type': type.value, 'allow': allow != null ? Helper.reduceRolePermissions(allow) : null, 'deny': deny != null ? Helper.reduceRolePermissions(deny) : null }); + print(response.body); if(response.statusCode != 204) { throw ApiError(prefix: 'channel overwrite', cause: 'You can\'t edit the permissions of this channel!'); } - } + }*/ factory PermissionOverwrite.from({required dynamic payload}) { return PermissionOverwrite(