hikari-arc 1.3.2__py3-none-any.whl → 1.3.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
arc/abc/client.py CHANGED
@@ -333,10 +333,10 @@ class Client(t.Generic[AppT], abc.ABC):
333
333
  inj_ctx = alluka.OverridingContext.from_client(self.injector)
334
334
 
335
335
  for hook in self._injection_hooks:
336
- if inspect.iscoroutinefunction(hook):
337
- await hook(ctx, inj_ctx)
338
- else:
339
- hook(ctx, inj_ctx)
336
+ res = hook(ctx, inj_ctx)
337
+
338
+ if inspect.isawaitable(res):
339
+ await res
340
340
  return inj_ctx
341
341
 
342
342
  def _provide_command_locale(self, request: CommandLocaleRequest) -> LocaleResponse:
arc/abc/command.py CHANGED
@@ -2,7 +2,6 @@ from __future__ import annotations
2
2
 
3
3
  import abc
4
4
  import asyncio
5
- import inspect
6
5
  import typing as t
7
6
 
8
7
  import attr
@@ -549,10 +548,7 @@ class CommandBase(
549
548
  try:
550
549
  hooks = command._resolve_hooks()
551
550
  for hook in hooks:
552
- if inspect.iscoroutinefunction(hook):
553
- res = await ctx._injection_ctx.call_with_async_di(hook, ctx)
554
- else:
555
- res = ctx._injection_ctx.call_with_di(hook, ctx)
551
+ res = await ctx._injection_ctx.call_with_async_di(hook, ctx)
556
552
 
557
553
  res = t.cast(HookResult | None, res)
558
554
 
@@ -569,10 +565,7 @@ class CommandBase(
569
565
  try:
570
566
  post_hooks = command._resolve_post_hooks()
571
567
  for hook in post_hooks:
572
- if inspect.iscoroutinefunction(hook):
573
- await ctx._injection_ctx.call_with_async_di(hook, ctx)
574
- else:
575
- ctx._injection_ctx.call_with_di(hook, ctx)
568
+ await ctx._injection_ctx.call_with_async_di(hook, ctx)
576
569
  except Exception as e:
577
570
  await command._handle_exception(ctx, e)
578
571
  finally:
arc/internal/about.py CHANGED
@@ -5,7 +5,7 @@ __author_email__: t.Final[str] = "git@hypergonial.com"
5
5
  __maintainer__: t.Final[str] = "hypergonial"
6
6
  __license__: t.Final[str] = "MIT"
7
7
  __url__: t.Final[str] = "https://github.com/hypergonial/hikari-arc"
8
- __version__: t.Final[str] = "1.3.2"
8
+ __version__: t.Final[str] = "1.3.4"
9
9
 
10
10
  # MIT License
11
11
  #
arc/utils/hooks/basic.py CHANGED
@@ -5,6 +5,7 @@ import typing as t
5
5
  import hikari
6
6
 
7
7
  from arc.abc.hookable import HookResult
8
+ from arc.context import Context # noqa: TCH001 Needed for DI to work
8
9
  from arc.errors import (
9
10
  BotMissingPermissionsError,
10
11
  DMOnlyError,
@@ -13,9 +14,6 @@ from arc.errors import (
13
14
  NotOwnerError,
14
15
  )
15
16
 
16
- if t.TYPE_CHECKING:
17
- from arc.context import Context
18
-
19
17
 
20
18
  def guild_only(ctx: Context[t.Any]) -> HookResult:
21
19
  """A pre-execution hook that aborts the execution of a command if it is invoked outside of a guild.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hikari-arc
3
- Version: 1.3.2
3
+ Version: 1.3.4
4
4
  Summary: A command handler for hikari with a focus on type-safety and correctness.
5
5
  Home-page: https://github.com/hypergonial/hikari-arc
6
6
  Author: hypergonial
@@ -31,15 +31,15 @@ Provides-Extra: cron
31
31
  Requires-Dist: croniter ==2.0.5 ; extra == 'cron'
32
32
  Requires-Dist: types-croniter ==2.0.0.20240423 ; extra == 'cron'
33
33
  Provides-Extra: dev
34
- Requires-Dist: ruff ==0.4.5 ; extra == 'dev'
35
- Requires-Dist: pyright ==1.1.364 ; extra == 'dev'
34
+ Requires-Dist: ruff ==0.4.6 ; extra == 'dev'
35
+ Requires-Dist: pyright ==1.1.365 ; extra == 'dev'
36
36
  Requires-Dist: nox ==2024.4.15 ; extra == 'dev'
37
- Requires-Dist: typing-extensions ==4.11.0 ; extra == 'dev'
37
+ Requires-Dist: typing-extensions ==4.12.0 ; extra == 'dev'
38
38
  Requires-Dist: pytest ==8.2.1 ; extra == 'dev'
39
39
  Requires-Dist: pytest-asyncio ==0.23.7 ; extra == 'dev'
40
40
  Requires-Dist: slotscheck ==0.19.0 ; extra == 'dev'
41
41
  Provides-Extra: docs
42
- Requires-Dist: mkdocs-material[imaging] ~=9.5.24 ; extra == 'docs'
42
+ Requires-Dist: mkdocs-material[imaging] ~=9.5.25 ; extra == 'docs'
43
43
  Requires-Dist: mkdocs ~=1.6.0 ; extra == 'docs'
44
44
  Requires-Dist: mkdocstrings-python ~=1.10.3 ; extra == 'docs'
45
45
  Requires-Dist: black ~=24.4.2 ; extra == 'docs'
@@ -8,8 +8,8 @@ arc/locale.py,sha256=nEKKQi-oKdU8VZQdWdFTL-tNECwhtTVv3I3vTsU_1f8,4921
8
8
  arc/plugin.py,sha256=8-TGlfxPUYy6uRr-o_LXYD4t5CnQ1lQvQ0psGkkI6L0,8622
9
9
  arc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  arc/abc/__init__.py,sha256=J9KxcN9gHHKW_GDrJD_5fu76Ya6l4XvPHe0Vdqza0Pk,2277
11
- arc/abc/client.py,sha256=EGrtxvqaKaYJBKR6g-6XCh7dRtSU6ly8aTPk_hrWPe4,54147
12
- arc/abc/command.py,sha256=rWaBt4pD2ivZdLRtqAcLrURrFSOBW3Oqdj1s_s9ALGw,28769
11
+ arc/abc/client.py,sha256=iXcWXYx-5Mv6fUWx7inxw6T93gNgd_zTpA-luFtpVcQ,54108
12
+ arc/abc/command.py,sha256=u2wjx4PHFWlCFz2OyuMNOUSCf5l0Y1rn0d8yjVPtGC0,28462
13
13
  arc/abc/concurrency_limiting.py,sha256=Ed3AUb0veY2H85X8nz9qnAPFC9aRpx9dc4xApxzaLwE,4665
14
14
  arc/abc/error_handler.py,sha256=MvT6Pl6iCuTyRi8KFQBLzoPJLDS6UcH_nzLtxFmeRHw,3701
15
15
  arc/abc/hookable.py,sha256=qDb-PLJcLE8cE49YKQGvNUQ6B2B5ALRcPVssEXeznNw,5484
@@ -38,7 +38,7 @@ arc/context/autocomplete.py,sha256=YOu6leCKH0mfGVj0vmo4kj1_cWUM6c_vjgooymQ6sYY,3
38
38
  arc/context/base.py,sha256=4hF_p-_mnzhdw5MlVLN7EATfKg8jGAKRkkXtxRggQbc,39976
39
39
  arc/ext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
40
  arc/internal/__init__.py,sha256=kZKBSFOkaDLe5kBvxiCQ-MWRPUZ_GBZdWwINPMkSbvo,1436
41
- arc/internal/about.py,sha256=I2hSBdxwwd_Ud-z1URRrhmh3wF2afFT32YheSKNUIdw,1414
41
+ arc/internal/about.py,sha256=e677O8g83KO6DwVEHkwXHRKJVONV-usPtnl9V3CkmQQ,1414
42
42
  arc/internal/deprecation.py,sha256=Lnirv1z_oj6QJvbnd38TwHQnhHhFD2rTqqvH96pxiWE,2204
43
43
  arc/internal/options.py,sha256=EODBho9BdHOgjqqOVAEEbwOkZJiVfjFDDpUztGKUdK4,3622
44
44
  arc/internal/sigparse.py,sha256=EsewKxcidtuoY0clEAVh8nVGmTq5hvAHxqokGOAcZPk,13518
@@ -50,10 +50,10 @@ arc/utils/concurrency_limiter.py,sha256=YocMFU0sajLWnsajzZ7T2Qvpd9PKjc2koDqflQTJ
50
50
  arc/utils/loops.py,sha256=CqRe6tpgzdyvD3POHiSoXATDhPklalMtswvGhcBt964,14009
51
51
  arc/utils/ratelimiter.py,sha256=YPETOjQOga8RazYoK3Ghueh2TsOdfkH7WM58dr3ybcU,9477
52
52
  arc/utils/hooks/__init__.py,sha256=pXlAQ1zGxQV-bBeeL8sKRkUyO1PmEazT_a_XKtf7GFA,515
53
- arc/utils/hooks/basic.py,sha256=q6aXAyV7qPGbaQXg0Z2piPAVr1L9uN2hJGjXsbyumLE,5889
53
+ arc/utils/hooks/basic.py,sha256=PushSBY03A8Yq60uTRyQKLL74FUqF0DmumzXAW8kaGk,5902
54
54
  arc/utils/hooks/limiters.py,sha256=D0brZBnLqhUF7ycs16JllsW6gYqdlHnNOISH8iMBWkw,7490
55
- hikari_arc-1.3.2.dist-info/LICENSE,sha256=q_osUjCCfQVI7zzgteLMZ-RlhXlB4rqQE8I0DGh7ur4,1076
56
- hikari_arc-1.3.2.dist-info/METADATA,sha256=xcN3hVwAQFTb0EnJFYvtWHjtrxyRaJmF2mY7Y78sIMU,5563
57
- hikari_arc-1.3.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
58
- hikari_arc-1.3.2.dist-info/top_level.txt,sha256=kTs_REfGfSlIT6Hq_kxH-MtDlOO6LPwFwkOoNdDCnJ4,4
59
- hikari_arc-1.3.2.dist-info/RECORD,,
55
+ hikari_arc-1.3.4.dist-info/LICENSE,sha256=q_osUjCCfQVI7zzgteLMZ-RlhXlB4rqQE8I0DGh7ur4,1076
56
+ hikari_arc-1.3.4.dist-info/METADATA,sha256=WBCIGP0HraGboqdAYm5BMN_5mgviXgf3gedBRQh7K-o,5563
57
+ hikari_arc-1.3.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
58
+ hikari_arc-1.3.4.dist-info/top_level.txt,sha256=kTs_REfGfSlIT6Hq_kxH-MtDlOO6LPwFwkOoNdDCnJ4,4
59
+ hikari_arc-1.3.4.dist-info/RECORD,,