Don't use Bulk Channel Edit endpoint if not actually moving channels.
Should make the category-only edit cases more straightforward since it does not rely on other guilds in the cache, outside of the category itself.
This commit is contained in:
parent
148816c4e8
commit
f86ac47b28
@ -239,7 +239,10 @@ class GuildChannel:
|
|||||||
position = options.pop('position')
|
position = options.pop('position')
|
||||||
except KeyError:
|
except KeyError:
|
||||||
if parent_id is not _undefined:
|
if parent_id is not _undefined:
|
||||||
yield from self._move(self.position, parent_id=parent_id, lock_permissions=lock_permissions, reason=reason)
|
if lock_permissions:
|
||||||
|
category = self.guild.get_channel(parent_id)
|
||||||
|
options['permission_overwrites'] = [c._asdict() for c in category._overwrites]
|
||||||
|
options['parent_id'] = parent_id
|
||||||
elif lock_permissions and self.category_id is not None:
|
elif lock_permissions and self.category_id is not None:
|
||||||
# if we're syncing permissions on a pre-existing channel category without changing it
|
# if we're syncing permissions on a pre-existing channel category without changing it
|
||||||
# we need to update the permissions to point to the pre-existing category
|
# we need to update the permissions to point to the pre-existing category
|
||||||
|
@ -500,7 +500,7 @@ class HTTPClient:
|
|||||||
|
|
||||||
def edit_channel(self, channel_id, *, reason=None, **options):
|
def edit_channel(self, channel_id, *, reason=None, **options):
|
||||||
r = Route('PATCH', '/channels/{channel_id}', channel_id=channel_id)
|
r = Route('PATCH', '/channels/{channel_id}', channel_id=channel_id)
|
||||||
valid_keys = ('name', 'topic', 'bitrate', 'nsfw', 'user_limit', 'position', 'permission_overwrites')
|
valid_keys = ('name', 'parent_id', 'topic', 'bitrate', 'nsfw', 'user_limit', 'position', 'permission_overwrites')
|
||||||
payload = {
|
payload = {
|
||||||
k: v for k, v in options.items() if k in valid_keys
|
k: v for k, v in options.items() if k in valid_keys
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user