Skip to content

Commit

Permalink
fix: Remove edit method
Browse files Browse the repository at this point in the history
  • Loading branch information
vic256 committed Jul 17, 2022
1 parent 8a194c9 commit 86f303a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/src/api/channels/permission_overwrite.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,29 @@ class PermissionOverwrite {
};
}

/// ### Edit [PermissionOverwrite] of a [Channel]
/* /// ### Edit [PermissionOverwrite] of a [Channel]
///
/// Example :
/// ```dart
/// final TextChannel channel = guild.channels.cache.get('240561194958716924');
/// final PermissionOverwrite overwrite = await channel.permissionOverwrites.cache.getOrFail('240561194958716928');
///
/// await overwrite.edit(allow: [Permission.sendMessages], deny: [Permission.banMembers, Permission.attachFiles]);
/// ```
Future<void> edit ({List<Permission>? allow, List<Permission>? deny}) async {
final Http http = ioc.singleton(ioc.services.client);
/// ```*/
/* Future<void> edit ({List<Permission>? allow, List<Permission>? 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(
Expand Down

0 comments on commit 86f303a

Please sign in to comment.