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(