Repository: hikari-py/hikari
Pull request #1025 (2022-02-20 09:04:46)

Add get_guild() to hikari.Member
### Summary

This PR adds `get_guild()` to `hikari.Member`.

### Checklist
<!-- Make sure to tick all the following boxes by putting an `x` in between (like this `[x]`) -->
- [x] I have run `nox` and all the pipelines have passed.
- [x] I have made unittests according to the code I have added/modified/deleted.

<!--
To mention an issue use `#issue-id` and to mention a merge request use `!merge-request-id`
To close/fix an issue use `Close #issue-id` or `Fix #issue-id` (depending on the merge request)
-->



Patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e6faf5e6..fede8ed8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -7,7 +7,7 @@ on:
 jobs:
   test:
     strategy:
-      # Allows for matrix sub-jobs to fail without canceling the rest
+      # Allows for matrix sub-jobs to fail without cancelling the rest
       fail-fast: false
       matrix:
         os: [ubuntu-latest, macos-latest, windows-latest]
@@ -139,7 +139,7 @@ jobs:
           python-version: 3.8
 
       - name: Setup node
-        uses: actions/setup-node@v2.5.1
+        uses: actions/setup-node@v3
 
       - name: Build pages
         run: |
diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml
index 792cc43f..c94d6806 100644
--- a/.github/workflows/prepare-release.yml
+++ b/.github/workflows/prepare-release.yml
@@ -8,7 +8,7 @@ on:
         required: true
 
 jobs:
-  prepare-relese:
+  prepare-release:
     runs-on: ubuntu-latest
 
     steps:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 39bc2380..b62581b7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -77,7 +77,7 @@ Bugfixes
 - Fix `PartialSticker.image_url` not passing the hash as a string ([#930](https://github.com/hikari-py/hikari/issues/930))
 - Fixed the url being generated for role icons to not erroneously insert ".png" before the file extension ([#931](https://github.com/hikari-py/hikari/issues/931))
 - Fix some bugs in message deserialization
-    - Remove case for setting `member` and `referece_message` to `undefined.Undefined` in full message deserialization
+    - Remove case for setting `member` and `reference_message` to `undefined.Undefined` in full message deserialization
     - Don't set `message.member` to `undefined.UNDEFINED` on partial message deserialization if message was sent by a webhook ([#933](https://github.com/hikari-py/hikari/issues/933))
 
 
diff --git a/changes/1025.feature.md b/changes/1025.feature.md
new file mode 100644
index 00000000..e3d34eca
--- /dev/null
+++ b/changes/1025.feature.md
@@ -0,0 +1,1 @@
+`get_guild()` is now available on `hikari.Member`.
diff --git a/dev-requirements.txt b/dev-requirements.txt
index 832bded0..85ffba76 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -12,7 +12,7 @@ pytest-cov==3.0.0
 pytest-randomly==3.11.0
 
 # Coverage testing.
-coverage[toml]==6.3.1
+coverage[toml]==6.3.2
 
 # Other stuff
 async-timeout==4.0.2  # Used for timeouts in some test cases.
@@ -29,7 +29,7 @@ sphobjinv==2.2.1
 #################
 
 mypy==0.931
-pyright==0.0.13
+pyright==0.0.13.post0
 
 #######################
 # DEPENDENCY CHECKING #
diff --git a/flake8-requirements.txt b/flake8-requirements.txt
index dc5f44e6..797bb9d1 100644
--- a/flake8-requirements.txt
+++ b/flake8-requirements.txt
@@ -4,7 +4,7 @@ flake8==4.0.1
 # Ref: https://github.com/DmytroLitvinov/awesome-flake8-extensions
 
 flake8-bandit~=2.1.2                    # runs bandit
-flake8-black==0.2.4                     # runs black
+flake8-black==0.2.5                     # runs black
 flake8-broken-line==0.4.0               # forbey "\" linebreaks
 flake8-builtins==1.5.3                  # builtin shadowing checks
 flake8-coding==1.3.2                    # coding magic-comment detection
@@ -13,7 +13,7 @@ flake8-deprecated==1.3                  # deprecated call checks
 flake8-docstrings==1.6.0                # pydocstyle support
 flake8-executable==2.1.1                # shebangs
 flake8-fixme==1.1.1                     # "fix me" counter
-flake8-functions==0.0.6                 # function linting
+flake8-functions==0.0.7                 # function linting
 flake8-html==0.4.1                      # html output
 flake8-if-statements==0.1.0             # condition linting
 flake8-isort==4.1.1                     # runs isort
diff --git a/hikari/api/interaction_server.py b/hikari/api/interaction_server.py
index 2898b9c4..4d59902b 100644
--- a/hikari/api/interaction_server.py
+++ b/hikari/api/interaction_server.py
@@ -46,7 +46,7 @@
 """Type hint of a Interaction server's listener callback.
 
 This should be an async callback which takes in one positional argument which
-subclases `hikari.interactions.base_interactions.PartialInteraction` and may return an
+subclasses `hikari.interactions.base_interactions.PartialInteraction` and may return an
 instance of the relevant `hikari.api.special_endpoints.InteractionResponseBuilder`
 subclass for the provided interaction type which will instruct the server on how
 to respond.
diff --git a/hikari/api/rest.py b/hikari/api/rest.py
index f750d049..b953f94e 100644
--- a/hikari/api/rest.py
+++ b/hikari/api/rest.py
@@ -1988,7 +1988,7 @@ async def fetch_webhook(
         Other Parameters
         ----------------
         token : hikari.undefined.UndefinedOr[builtins.str]
-            If provided, the webhoook token that will be used to fetch
+            If provided, the webhook token that will be used to fetch
             the webhook instead of the token the client was initialized with.
 
         Returns
@@ -2125,7 +2125,7 @@ async def edit_webhook(
         Other Parameters
         ----------------
         token : hikari.undefined.UndefinedOr[builtins.str]
-            If provided, the webhoook token that will be used to edit
+            If provided, the webhook token that will be used to edit
             the webhook instead of the token the client was initialized with.
         name : hikari.undefined.UndefinedOr[builtins.str]
             If provided, the new webhook name.
@@ -2185,7 +2185,7 @@ async def delete_webhook(
         Other Parameters
         ----------------
         token : hikari.undefined.UndefinedOr[builtins.str]
-            If provided, the webhoook token that will be used to delete
+            If provided, the webhook token that will be used to delete
             the webhook instead of the token the client was initialized with.
 
         Raises
@@ -2196,7 +2196,7 @@ async def delete_webhook(
         hikari.errors.UnauthorizedError
             If you are unauthorized to make the request (invalid/missing token).
         hikari.errors.NotFoundError
-            If the webhoook is not found.
+            If the webhook is not found.
         hikari.errors.RateLimitTooLongError
             Raised in the event that a rate limit occurs that is
             longer than `max_rate_limit` when making a request.
@@ -2885,7 +2885,7 @@ def fetch_my_guilds(
         Other Parameters
         ----------------
         newest_first : builtins.bool
-            Whether to fetch the newest first or the olders first.
+            Whether to fetch the newest first or the oldest first.
             Defaults to `builtins.False`.
         start_at : hikari.undefined.UndefinedOr[hikari.snowflakes.SearchableSnowflakeishOr[hikari.guilds.PartialGuild]]
             If provided, will start at this snowflake. If you provide
@@ -7234,7 +7234,7 @@ async def fetch_application_command_permissions(
         guild : hikari.undefined.UndefinedOr[hikari.snowflakes.SnowflakeishOr[hikari.guilds.PartialGuild]]
             Object or ID of the guild to fetch the command permissions for.
         command: hikari.snowflakes.SnowflakeishOr[hikari.commands.PartialCommand]
-            Objecr or ID of the command to fetch the command permissions for.
+            Object or ID of the command to fetch the command permissions for.
 
         Returns
         -------
diff --git a/hikari/guilds.py b/hikari/guilds.py
index 47a27f2c..b4728428 100644
--- a/hikari/guilds.py
+++ b/hikari/guilds.py
@@ -508,7 +508,7 @@ def mention(self) -> str:
     def communication_disabled_until(self) -> typing.Optional[datetime.datetime]:
         """Return when the timeout for this member ends.
 
-        Unlike `raw_communictation_disabled_until`, this will always be
+        Unlike `raw_communication_disabled_until`, this will always be
         `builtins.None` if the member is not currently timed out.
 
         !!! note
@@ -522,6 +522,19 @@ def communication_disabled_until(self) -> typing.Optional[datetime.datetime]:
             return self.raw_communication_disabled_until
         return None
 
+    def get_guild(self) -> typing.Optional[Guild]:
+        """Return the guild associated with this member.
+
+        Returns
+        -------
+        typing.Optional[hikari.guilds.Guild]
+            `builtins.None` if the the guild is not cached.
+        """
+        if not isinstance(self.user.app, traits.CacheAware):
+            return None
+
+        return self.user.app.cache.get_guild(self.guild_id)
+
     def get_presence(self) -> typing.Optional[presences_.MemberPresence]:
         """Get the cached presence for this member, if known.
 
@@ -3334,7 +3347,7 @@ async def fetch_public_updates_channel(self) -> typing.Optional[channels_.GuildT
         Returns
         -------
         typing.Optional[hikari.channels.GuildTextChannel]
-            The channel where discord sents relevant updates to moderators and admins.
+            The channel where discord sends relevant updates to moderators and admins.
 
         Raises
         ------
diff --git a/hikari/impl/bot.py b/hikari/impl/bot.py
index afda60c7..01744f21 100644
--- a/hikari/impl/bot.py
+++ b/hikari/impl/bot.py
@@ -572,7 +572,7 @@ async def on_everyone_mentioned(event):
         Listen: `hikari.impl.bot.GatewayBot.listen`
         Stream: `hikari.impl.bot.GatewayBot.stream`
         Subscribe: `hikari.impl.bot.GatewayBot.subscribe`
-        Unubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
+        Unsubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
         Wait_for: `hikari.impl.bot.GatewayBot.wait_for`
         """
         return self._event_manager.dispatch(event)
@@ -643,7 +643,7 @@ def listen(
         Dispatch: `hikari.impl.bot.GatewayBot.dispatch`
         Stream: `hikari.impl.bot.GatewayBot.stream`
         Subscribe: `hikari.impl.bot.GatewayBot.subscribe`
-        Unubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
+        Unsubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
         Wait_for: `hikari.impl.bot.GatewayBot.wait_for`
         """
         return self._event_manager.listen(event_type)
@@ -735,7 +735,7 @@ def run(
         close_loop : builtins.bool
             Defaults to `builtins.True`. If `builtins.True`, then once the bot
             enters a state where all components have shut down permanently
-            during application shutdown, then all asyngens and background tasks
+            during application shutdown, then all asyncgens and background tasks
             will be destroyed, and the event loop will be shut down.
 
             This will wait until all `hikari`-owned `aiohttp` connectors have
@@ -1152,7 +1152,7 @@ def stream(
         Dispatch: `hikari.impl.bot.GatewayBot.dispatch`
         Listen: `hikari.impl.bot.GatewayBot.listen`
         Subscribe: `hikari.impl.bot.GatewayBot.subscribe`
-        Unubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
+        Unsubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
         Wait_for: `hikari.impl.bot.GatewayBot.wait_for`
         """
         self._check_if_alive()
@@ -1191,7 +1191,7 @@ async def on_message(event):
         Dispatch: `hikari.impl.bot.GatewayBot.dispatch`
         Listen: `hikari.impl.bot.GatewayBot.listen`
         Stream: `hikari.impl.bot.GatewayBot.stream`
-        Unubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
+        Unsubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
         Wait_for: `hikari.impl.bot.GatewayBot.wait_for`
         """
         self._event_manager.subscribe(event_type, callback)
@@ -1279,7 +1279,7 @@ async def wait_for(
         Listen: `hikari.impl.bot.GatewayBot.listen`
         Stream: `hikari.impl.bot.GatewayBot.stream`
         Subscribe: `hikari.impl.bot.GatewayBot.subscribe`
-        Unubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
+        Unsubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
         """
         self._check_if_alive()
         return await self._event_manager.wait_for(event_type, timeout=timeout, predicate=predicate)
diff --git a/hikari/impl/event_manager_base.py b/hikari/impl/event_manager_base.py
index ed12ebe3..c70d04a7 100644
--- a/hikari/impl/event_manager_base.py
+++ b/hikari/impl/event_manager_base.py
@@ -135,7 +135,7 @@ async def __aenter__(self: _EventStreamT) -> _EventStreamT:
             # This is sync only.
             warnings.warn(
                 "Using EventStream as an async context manager has been deprecated since 2.0.0.dev104. "
-                "Please use it as a sycnrhonous context manager (e.g. with bot.stream(...)) instead.",
+                "Please use it as a synchronous context manager (e.g. with bot.stream(...)) instead.",
                 category=DeprecationWarning,
                 stacklevel=2,
             )
diff --git a/hikari/impl/interaction_server.py b/hikari/impl/interaction_server.py
index e3156a39..77d1f7dd 100644
--- a/hikari/impl/interaction_server.py
+++ b/hikari/impl/interaction_server.py
@@ -235,7 +235,7 @@ async def aiohttp_hook(self, request: aiohttp.web.Request) -> aiohttp.web.Respon
 
         Returns
         -------
-        aiohtttp.web.Response
+        aiohttp.web.Response
             The aiohttp response.
         """
         if request.content_type.lower() != _JSON_CONTENT_TYPE:
diff --git a/hikari/impl/rate_limits.py b/hikari/impl/rate_limits.py
index 54f41847..97551e6c 100644
--- a/hikari/impl/rate_limits.py
+++ b/hikari/impl/rate_limits.py
@@ -250,7 +250,7 @@ class WindowedBurstRateLimiter(BurstRateLimiter):
     Rate limiter for rate limits that last fixed periods of time with a
     fixed number of times it can be used in that time frame.
 
-    To use this, you should call WindowedBurstRateLimiter.aquire` and await the
+    To use this, you should call WindowedBurstRateLimiter.acquire` and await the
     result immediately before performing your rate-limited task.
 
     If the rate limit has been hit, acquiring time will return an incomplete
diff --git a/hikari/impl/rest_bot.py b/hikari/impl/rest_bot.py
index fadfc01a..4f83bff3 100644
--- a/hikari/impl/rest_bot.py
+++ b/hikari/impl/rest_bot.py
@@ -415,7 +415,7 @@ def run(
         close_loop : builtins.bool
             Defaults to `builtins.True`. If `builtins.True`, then once the bot
             enters a state where all components have shut down permanently
-            during application shutdown, then all asyngens and background tasks
+            during application shutdown, then all asyncgens and background tasks
             will be destroyed, and the event loop will be shut down.
 
             This will wait until all `hikari`-owned `aiohttp` connectors have
diff --git a/hikari/internal/data_binding.py b/hikari/internal/data_binding.py
index 249d6270..e6550e13 100644
--- a/hikari/internal/data_binding.py
+++ b/hikari/internal/data_binding.py
@@ -49,7 +49,7 @@
     import concurrent
     import contextlib
 
-    T = typing.TypeVar("T", covariant=True)
+    T_co = typing.TypeVar("T_co", covariant=True)
 
 Headers = typing.Mapping[str, str]
 """Type hint for HTTP headers."""
@@ -170,10 +170,10 @@ def put(
     def put(
         self,
         key: str,
-        value: undefined.UndefinedOr[T],
+        value: undefined.UndefinedOr[T_co],
         /,
         *,
-        conversion: typing.Callable[[T], Stringish],
+        conversion: typing.Callable[[T_co], Stringish],
     ) -> None:
         ...
 
@@ -255,10 +255,10 @@ def put(self, key: str, value: undefined.UndefinedNoneOr[JSONish], /) -> None:
     def put(
         self,
         key: str,
-        value: undefined.UndefinedNoneOr[T],
+        value: undefined.UndefinedNoneOr[T_co],
         /,
         *,
-        conversion: typing.Callable[[T], JSONish],
+        conversion: typing.Callable[[T_co], JSONish],
     ) -> None:
         ...
 
@@ -309,10 +309,10 @@ def put_array(
     def put_array(
         self,
         key: str,
-        values: undefined.UndefinedOr[typing.Iterable[T]],
+        values: undefined.UndefinedOr[typing.Iterable[T_co]],
         /,
         *,
-        conversion: typing.Callable[[T], JSONish],
+        conversion: typing.Callable[[T_co], JSONish],
     ) -> None:
         ...
 
@@ -334,7 +334,7 @@ def put_array(
         ----------
         key : builtins.str
             The key to give the element.
-        values : hikari.undefined.UndefinedOr[typing.Iterable[T]]
+        values : hikari.undefined.UndefinedOr[typing.Iterable[T_co]]
             The JSON types to put. This may be an iterable of non-JSON types if
             a conversion is also specified. This may alternatively be undefined.
             In the latter case, nothing is performed.
diff --git a/hikari/internal/enums.py b/hikari/internal/enums.py
index 3fefaae9..25746880 100644
--- a/hikari/internal/enums.py
+++ b/hikari/internal/enums.py
@@ -696,7 +696,7 @@ def split(self: _T) -> typing.Sequence[_T]:
 
         Any unrecognised bits will be omitted for brevity.
 
-        The result will be a name-sorted `typing.Sequence` of each membe
+        The result will be a name-sorted `typing.Sequence` of each member
         """
         return sorted(
             (member for member in self.__class__._powers_of_2_to_member_map_.values() if member.value & self),
diff --git a/hikari/internal/time.py b/hikari/internal/time.py
index 26740f9b..813e479b 100644
--- a/hikari/internal/time.py
+++ b/hikari/internal/time.py
@@ -201,12 +201,12 @@ def utc_datetime() -> datetime.datetime:
 
 # time.monotonic_ns is no slower than time.monotonic, but is more accurate.
 # Also, fun fact that monotonic_ns appears to be 1µs faster on average than
-# monotonic on AARM64 architectures, but on x86, monotonic is around 1ns faster
+# monotonic on ARM64 architectures, but on x86, monotonic is around 1ns faster
 # than monotonic_ns. Just thought that was kind of interesting to note down.
 # (RPi 3B versus i7 6700)
 
-# time.perf_counter and time.perf_counter_ns dont have proper typehints, causing
-# pdoc to not be able to recognice them. This is just a little hack around that.
+# time.perf_counter and time.perf_counter_ns don't have proper typehints, causing
+# pdoc to not be able to recognise them. This is just a little hack around that.
 def monotonic() -> float:
     """Performance counter for benchmarking."""  # noqa: D401 - Imperative mood
     return time.perf_counter()
diff --git a/hikari/presences.py b/hikari/presences.py
index 8c03e74c..7a6248f4 100644
--- a/hikari/presences.py
+++ b/hikari/presences.py
@@ -170,7 +170,7 @@ def large_image_url(self) -> typing.Optional[files.URL]:
 
         !!! note
             This will be `builtins.None` if no large image asset exists or if the
-            asset's dymamic URL (indicated by a `{name}:` prefix) is not known.
+            asset's dynamic URL (indicated by a `{name}:` prefix) is not known.
         """
         try:
             return self.make_large_image_url()
@@ -215,7 +215,7 @@ def small_image_url(self) -> typing.Optional[files.URL]:
 
         !!! note
             This will be `builtins.None` if no large image asset exists or if the
-            asset's dymamic URL (indicated by a `{name}:` prefix) is not known.
+            asset's dynamic URL (indicated by a `{name}:` prefix) is not known.
         """
         try:
             return self.make_small_image_url()
@@ -295,7 +295,7 @@ class ActivityFlag(enums.Flag):
     """Party privacy: friends only."""
 
     PARTY_PRIVACY_VOICE_CHANNEL = 1 << 7
-    """Party prvacy: voice channel only."""
+    """Party privacy: voice channel only."""
 
     EMBEDDED = 1 << 8
     """An activity that's embedded into a voice channel."""
diff --git a/hikari/snowflakes.py b/hikari/snowflakes.py
index 501d63a0..6e97be91 100644
--- a/hikari/snowflakes.py
+++ b/hikari/snowflakes.py
@@ -218,7 +218,7 @@ def calculate_shard_id(
 
 The valid types for this type hint are:
 
-- `buitlins.int`
+- `builtins.int`
 - `Snowflake`
 """
 
@@ -235,7 +235,7 @@ def calculate_shard_id(
 
 The valid types for this type hint are:
 
-- `buitlins.int`
+- `builtins.int`
 - `Snowflake`
 - `datetime.datetime`
 """


Test patch:
diff --git a/tests/hikari/impl/test_buckets.py b/tests/hikari/impl/test_buckets.py
index a6a65965..391945ff 100644
--- a/tests/hikari/impl/test_buckets.py
+++ b/tests/hikari/impl/test_buckets.py
@@ -272,7 +272,7 @@ async def test_acquire_route_when_not_in_routes_to_real_hashes_makes_new_bucket_
     async def test_acquire_route_when_not_in_routes_to_real_hashes_doesnt_cache_route(self):
         with buckets.RESTBucketManager(max_rate_limit=float("inf")) as mgr:
             route = mock.Mock()
-            route.create_real_bucket_hash = mock.Mock(wraps=lambda intial_hash: intial_hash + ";bobs")
+            route.create_real_bucket_hash = mock.Mock(wraps=lambda initial_hash: initial_hash + ";bobs")
 
             mgr.acquire(route)
 
@@ -296,7 +296,7 @@ async def test_acquire_route_returns_context_manager(self):
 
             bucket = mock.Mock(reset_at=time.perf_counter() + 999999999999999999999999999)
             with mock.patch.object(buckets, "RESTBucket", return_value=bucket):
-                route.create_real_bucket_hash = mock.Mock(wraps=lambda intial_hash: intial_hash + ";bobs")
+                route.create_real_bucket_hash = mock.Mock(wraps=lambda initial_hash: initial_hash + ";bobs")
 
                 assert mgr.acquire(route) is bucket
 
@@ -315,7 +315,7 @@ async def test_acquire_unknown_route_returns_context_manager_for_new_bucket(self
     async def test_update_rate_limits_if_wrong_bucket_hash_reroutes_route(self):
         with buckets.RESTBucketManager(max_rate_limit=float("inf")) as mgr:
             route = mock.Mock()
-            route.create_real_bucket_hash = mock.Mock(wraps=lambda intial_hash: intial_hash + ";bobs")
+            route.create_real_bucket_hash = mock.Mock(wraps=lambda initial_hash: initial_hash + ";bobs")
             mgr.routes_to_hashes[route.route] = "123"
 
             with mock.patch.object(hikari_date, "monotonic", return_value=27):
@@ -330,7 +330,7 @@ async def test_update_rate_limits_if_wrong_bucket_hash_reroutes_route(self):
     async def test_update_rate_limits_if_unknown_bucket_hash_reroutes_route(self):
         with buckets.RESTBucketManager(max_rate_limit=float("inf")) as mgr:
             route = mock.Mock()
-            route.create_real_bucket_hash = mock.Mock(wraps=lambda intial_hash: intial_hash + ";bobs")
+            route.create_real_bucket_hash = mock.Mock(wraps=lambda initial_hash: initial_hash + ";bobs")
             mgr.routes_to_hashes[route.route] = "123"
             bucket = mock.Mock()
             mgr.real_hashes_to_buckets["UNKNOWN;bobs"] = bucket
@@ -349,7 +349,7 @@ async def test_update_rate_limits_if_unknown_bucket_hash_reroutes_route(self):
     async def test_update_rate_limits_if_right_bucket_hash_does_nothing_to_hash(self):
         with buckets.RESTBucketManager(max_rate_limit=float("inf")) as mgr:
             route = mock.Mock()
-            route.create_real_bucket_hash = mock.Mock(wraps=lambda intial_hash: intial_hash + ";bobs")
+            route.create_real_bucket_hash = mock.Mock(wraps=lambda initial_hash: initial_hash + ";bobs")
             mgr.routes_to_hashes[route.route] = "123"
             bucket = mock.Mock(reset_at=time.perf_counter() + 999999999999999999999999999)
             mgr.real_hashes_to_buckets["123;bobs"] = bucket
@@ -365,7 +365,7 @@ async def test_update_rate_limits_if_right_bucket_hash_does_nothing_to_hash(self
     async def test_update_rate_limits_updates_params(self):
         with buckets.RESTBucketManager(max_rate_limit=float("inf")) as mgr:
             route = mock.Mock()
-            route.create_real_bucket_hash = mock.Mock(wraps=lambda intial_hash: intial_hash + ";bobs")
+            route.create_real_bucket_hash = mock.Mock(wraps=lambda initial_hash: initial_hash + ";bobs")
             mgr.routes_to_hashes[route.route] = "123"
             bucket = mock.Mock(reset_at=time.perf_counter() + 999999999999999999999999999)
             mgr.real_hashes_to_buckets["123;bobs"] = bucket
diff --git a/tests/hikari/test_guilds.py b/tests/hikari/test_guilds.py
index ec90efdd..3caf43cc 100644
--- a/tests/hikari/test_guilds.py
+++ b/tests/hikari/test_guilds.py
@@ -296,7 +296,7 @@ def test_communication_disabled_until_when_raw_communication_disabled_until_is_N
         with mock.patch.object(time, "utc_datetime", return_value=datetime.datetime(2021, 10, 18)):
             assert model.communication_disabled_until() is None
 
-    def test_comminucation_disabled_until_when_raw_communication_disabled_until_is_in_the_past(self, model):
+    def test_communication_disabled_until_when_raw_communication_disabled_until_is_in_the_past(self, model):
         model.raw_communication_disabled_until = datetime.datetime(2021, 10, 18)
 
         with mock.patch.object(time, "utc_datetime", return_value=datetime.datetime(2021, 11, 22)):
@@ -469,6 +469,26 @@ def test_mention_property_when_no_nickname(self, model, mock_user):
         model.nickname = None
         assert model.mention == mock_user.mention
 
+    def test_get_guild(self, model):
+        guild = mock.Mock(id=456)
+        model.user.app.cache.get_guild.side_effect = [guild]
+
+        assert model.get_guild() == guild
+
+        model.user.app.cache.get_guild.assert_has_calls([mock.call(456)])
+
+    def test_get_guild_when_guild_not_in_cache(self, model):
+        model.user.app.cache.get_guild.side_effect = [None]
+
+        assert model.get_guild() is None
+
+        model.user.app.cache.get_guild.assert_has_calls([mock.call(456)])
+
+    def test_get_guild_when_no_cache_trait(self, model):
+        model.user.app = object()
+
+        assert model.get_guild() is None
+
     def test_get_roles(self, model):
         role1 = mock.Mock(id=321, position=2)
         role2 = mock.Mock(id=654, position=1)