From dc042eb0266bdcdd4801bfdf65426cd74807e124 Mon Sep 17 00:00:00 2001 From: syncblaze Date: Wed, 16 Oct 2024 12:28:28 +0200 Subject: [PATCH 1/3] Removed ratelimit_per_user field from create_news_channel --- hikari/api/rest.py | 1 - hikari/guilds.py | 2 -- hikari/impl/rest.py | 2 -- tests/hikari/impl/test_rest.py | 2 -- tests/hikari/test_guilds.py | 5 +---- 5 files changed, 1 insertion(+), 11 deletions(-) diff --git a/hikari/api/rest.py b/hikari/api/rest.py index bd1bb960e..0b96ba62d 100644 --- a/hikari/api/rest.py +++ b/hikari/api/rest.py @@ -4286,7 +4286,6 @@ async def create_guild_news_channel( position: undefined.UndefinedOr[int] = undefined.UNDEFINED, topic: undefined.UndefinedOr[str] = undefined.UNDEFINED, nsfw: undefined.UndefinedOr[bool] = undefined.UNDEFINED, - rate_limit_per_user: undefined.UndefinedOr[time.Intervalish] = undefined.UNDEFINED, permission_overwrites: undefined.UndefinedOr[ typing.Sequence[channels_.PermissionOverwrite] ] = undefined.UNDEFINED, diff --git a/hikari/guilds.py b/hikari/guilds.py index 1decc55c2..53e739dea 100644 --- a/hikari/guilds.py +++ b/hikari/guilds.py @@ -2026,7 +2026,6 @@ async def create_news_channel( position: undefined.UndefinedOr[int] = undefined.UNDEFINED, topic: undefined.UndefinedOr[str] = undefined.UNDEFINED, nsfw: undefined.UndefinedOr[bool] = undefined.UNDEFINED, - rate_limit_per_user: undefined.UndefinedOr[time.Intervalish] = undefined.UNDEFINED, permission_overwrites: undefined.UndefinedOr[ typing.Sequence[channels_.PermissionOverwrite] ] = undefined.UNDEFINED, @@ -2086,7 +2085,6 @@ async def create_news_channel( position=position, topic=topic, nsfw=nsfw, - rate_limit_per_user=rate_limit_per_user, permission_overwrites=permission_overwrites, category=category, reason=reason, diff --git a/hikari/impl/rest.py b/hikari/impl/rest.py index 1fcf9c2ce..c9314c0dd 100644 --- a/hikari/impl/rest.py +++ b/hikari/impl/rest.py @@ -2745,7 +2745,6 @@ async def create_guild_news_channel( position: undefined.UndefinedOr[int] = undefined.UNDEFINED, topic: undefined.UndefinedOr[str] = undefined.UNDEFINED, nsfw: undefined.UndefinedOr[bool] = undefined.UNDEFINED, - rate_limit_per_user: undefined.UndefinedOr[time.Intervalish] = undefined.UNDEFINED, permission_overwrites: undefined.UndefinedOr[ typing.Sequence[channels_.PermissionOverwrite] ] = undefined.UNDEFINED, @@ -2760,7 +2759,6 @@ async def create_guild_news_channel( position=position, topic=topic, nsfw=nsfw, - rate_limit_per_user=rate_limit_per_user, permission_overwrites=permission_overwrites, category=category, default_auto_archive_duration=default_auto_archive_duration, diff --git a/tests/hikari/impl/test_rest.py b/tests/hikari/impl/test_rest.py index 8303f1543..606c506bb 100644 --- a/tests/hikari/impl/test_rest.py +++ b/tests/hikari/impl/test_rest.py @@ -4361,7 +4361,6 @@ async def test_create_guild_news_channel(self, rest_client: rest.RESTClientImpl) position=1, topic="general news", nsfw=False, - rate_limit_per_user=60, permission_overwrites=[overwrite1, overwrite2], category=category_channel, reason="because we need one", @@ -4376,7 +4375,6 @@ async def test_create_guild_news_channel(self, rest_client: rest.RESTClientImpl) position=1, topic="general news", nsfw=False, - rate_limit_per_user=60, permission_overwrites=[overwrite1, overwrite2], category=category_channel, reason="because we need one", diff --git a/tests/hikari/test_guilds.py b/tests/hikari/test_guilds.py index a8d657326..76a47c906 100644 --- a/tests/hikari/test_guilds.py +++ b/tests/hikari/test_guilds.py @@ -771,9 +771,7 @@ async def test_create_text_channel(self, model): async def test_create_news_channel(self, model): model.app.rest.create_guild_news_channel = mock.AsyncMock() - news_channel = await model.create_news_channel( - "cool news channel", position=1, nsfw=False, rate_limit_per_user=420 - ) + news_channel = await model.create_news_channel("cool news channel", position=1, nsfw=False) model.app.rest.create_guild_news_channel.assert_awaited_once_with( 90210, @@ -781,7 +779,6 @@ async def test_create_news_channel(self, model): position=1, topic=undefined.UNDEFINED, nsfw=False, - rate_limit_per_user=420, permission_overwrites=undefined.UNDEFINED, category=undefined.UNDEFINED, reason=undefined.UNDEFINED, From b51b731b2274c8bd38d9f0483a61750da9285300 Mon Sep 17 00:00:00 2001 From: syncblaze Date: Wed, 16 Oct 2024 12:32:25 +0200 Subject: [PATCH 2/3] Added changelog fragment --- changes/2079.bugfix.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/2079.bugfix.md diff --git a/changes/2079.bugfix.md b/changes/2079.bugfix.md new file mode 100644 index 000000000..5c5424640 --- /dev/null +++ b/changes/2079.bugfix.md @@ -0,0 +1 @@ +Removed rate_limit_per_user parameter from create_guild_news_channel From ef8f4a7aac46e2a4d98dc2b6626c4b1c6cebfe86 Mon Sep 17 00:00:00 2001 From: syncblaze Date: Wed, 16 Oct 2024 12:36:35 +0200 Subject: [PATCH 3/3] forgot docstrings --- hikari/api/rest.py | 4 ---- hikari/guilds.py | 4 ---- 2 files changed, 8 deletions(-) diff --git a/hikari/api/rest.py b/hikari/api/rest.py index 0b96ba62d..cb46aeeee 100644 --- a/hikari/api/rest.py +++ b/hikari/api/rest.py @@ -4309,10 +4309,6 @@ async def create_guild_news_channel( If provided, the channels topic. Maximum 1024 characters. nsfw If provided, whether to mark the channel as NSFW. - rate_limit_per_user - If provided, the amount of seconds a user has to wait - before being able to send another message in the channel. - Maximum 21600 seconds. permission_overwrites If provided, the permission overwrites for the channel. category diff --git a/hikari/guilds.py b/hikari/guilds.py index 53e739dea..46a722be9 100644 --- a/hikari/guilds.py +++ b/hikari/guilds.py @@ -2045,10 +2045,6 @@ async def create_news_channel( If provided, the channels topic. Maximum 1024 characters. nsfw If provided, whether to mark the channel as NSFW. - rate_limit_per_user - If provided, the amount of seconds a user has to wait - before being able to send another message in the channel. - Maximum 21600 seconds. permission_overwrites If provided, the permission overwrites for the channel. category