From 23a57e97ad649b1e1f6023c82addca160ea5dda6 Mon Sep 17 00:00:00 2001 From: davfsa Date: Thu, 14 Jan 2021 13:33:11 +0100 Subject: [PATCH] Rename `request_nonce` to `guild_chunk_nonce` --- hikari/events/guild_events.py | 2 +- hikari/impl/event_manager.py | 2 +- tests/hikari/impl/test_event_manager.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hikari/events/guild_events.py b/hikari/events/guild_events.py index 4925efc38b..f635006098 100644 --- a/hikari/events/guild_events.py +++ b/hikari/events/guild_events.py @@ -214,7 +214,7 @@ class GuildAvailableEvent(GuildVisibilityEvent): The voice states active in the guild. """ - request_nonce: typing.Optional[str] = attr.ib(repr=False, default=None) + guild_chunk_nonce: typing.Optional[str] = attr.ib(repr=False, default=None) """Nonce used to request the guild chunks. This will be `builtins.None` if no chunks were requested. diff --git a/hikari/impl/event_manager.py b/hikari/impl/event_manager.py index 811525966b..2a6a51caac 100644 --- a/hikari/impl/event_manager.py +++ b/hikari/impl/event_manager.py @@ -149,7 +149,7 @@ async def on_guild_create(self, shard: gateway_shard.GatewayShard, payload: data if members_declared and (event.guild.is_large or not presences_declared): # We create a task here instead of awaiting the result to avoid any rate-limits from delaying dispatch. nonce = f"{shard.id}.{time.uuid()}" - event.request_nonce = nonce + event.guild_chunk_nonce = nonce coroutine = shard.request_guild_members( event.guild, include_presences=bool(presences_declared), nonce=nonce ) diff --git a/tests/hikari/impl/test_event_manager.py b/tests/hikari/impl/test_event_manager.py index 0780f55580..acf5e155db 100644 --- a/tests/hikari/impl/test_event_manager.py +++ b/tests/hikari/impl/test_event_manager.py @@ -156,7 +156,7 @@ async def test_on_guild_create(self, event_manager, shard, app): members={"TestMember": 5678}, presences={"TestPresence": 9012}, voice_states={"TestState": 345}, - request_nonce=None, + guild_chunk_nonce=None, ) event_manager._app.event_factory.deserialize_guild_create_event.return_value = event @@ -164,7 +164,7 @@ async def test_on_guild_create(self, event_manager, shard, app): await event_manager.on_guild_create(shard, payload) - assert event.request_nonce is None + assert event.guild_chunk_nonce is None shard.request_guild_members.assert_not_called() event_manager._cache.update_guild.assert_called_once_with(event.guild) @@ -201,7 +201,7 @@ async def test_on_guild_create_when_request_chunks(self, event_manager, shard, a members={"TestMember": 5678}, presences={"TestPresence": 9012}, voice_states={"TestState": 345}, - request_nonce=None, + guild_chunk_nonce=None, ) event_manager._app.event_factory.deserialize_guild_create_event.return_value = event @@ -213,7 +213,7 @@ async def test_on_guild_create_when_request_chunks(self, event_manager, shard, a uuid.assert_called_once_with() nonce = "987.uuid" - assert event.request_nonce == nonce + assert event.guild_chunk_nonce == nonce shard.request_guild_members.assert_called_once_with(event.guild, include_presences=True, nonce=nonce) create_task.assert_called_once_with(shard.request_guild_members(), name="987:123 guild create members request")