librebots-hub 0.1.0__tar.gz

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.
Files changed (40) hide show
  1. librebots_hub-0.1.0/.gitignore +9 -0
  2. librebots_hub-0.1.0/.python-version +1 -0
  3. librebots_hub-0.1.0/LICENSE +21 -0
  4. librebots_hub-0.1.0/PKG-INFO +37 -0
  5. librebots_hub-0.1.0/README.md +23 -0
  6. librebots_hub-0.1.0/pyproject.toml +58 -0
  7. librebots_hub-0.1.0/src/librebots/hub/__init__.py +4 -0
  8. librebots_hub-0.1.0/src/librebots/hub/_channel.py +76 -0
  9. librebots_hub-0.1.0/src/librebots/hub/_reason.py +26 -0
  10. librebots_hub-0.1.0/src/librebots/hub/py.typed +0 -0
  11. librebots_hub-0.1.0/src/librebots/hub/v1/guilds_pb2.py +65 -0
  12. librebots_hub-0.1.0/src/librebots/hub/v1/guilds_pb2.pyi +313 -0
  13. librebots_hub-0.1.0/src/librebots/hub/v1/guilds_pb2_grpc.py +318 -0
  14. librebots_hub-0.1.0/src/librebots/hub/v1/guilds_pb2_grpc.pyi +112 -0
  15. librebots_hub-0.1.0/src/librebots/hub/v1/info_pb2.py +40 -0
  16. librebots_hub-0.1.0/src/librebots/hub/v1/info_pb2.pyi +51 -0
  17. librebots_hub-0.1.0/src/librebots/hub/v1/info_pb2_grpc.py +98 -0
  18. librebots_hub-0.1.0/src/librebots/hub/v1/info_pb2_grpc.pyi +52 -0
  19. librebots_hub-0.1.0/src/librebots/hub/v1/privacy_pb2.py +69 -0
  20. librebots_hub-0.1.0/src/librebots/hub/v1/privacy_pb2.pyi +328 -0
  21. librebots_hub-0.1.0/src/librebots/hub/v1/privacy_pb2_grpc.py +362 -0
  22. librebots_hub-0.1.0/src/librebots/hub/v1/privacy_pb2_grpc.pyi +124 -0
  23. librebots_hub-0.1.0/src/librebots/hub/v1/reasons_pb2.py +36 -0
  24. librebots_hub-0.1.0/src/librebots/hub/v1/reasons_pb2.pyi +38 -0
  25. librebots_hub-0.1.0/src/librebots/hub/v1/reasons_pb2_grpc.py +24 -0
  26. librebots_hub-0.1.0/src/librebots/hub/v1/reasons_pb2_grpc.pyi +20 -0
  27. librebots_hub-0.1.0/src/librebots/hub/v1/shards_pb2.py +36 -0
  28. librebots_hub-0.1.0/src/librebots/hub/v1/shards_pb2.pyi +42 -0
  29. librebots_hub-0.1.0/src/librebots/hub/v1/shards_pb2_grpc.py +24 -0
  30. librebots_hub-0.1.0/src/librebots/hub/v1/shards_pb2_grpc.pyi +20 -0
  31. librebots_hub-0.1.0/src/librebots/hub/v1/stats_pb2.py +45 -0
  32. librebots_hub-0.1.0/src/librebots/hub/v1/stats_pb2.pyi +108 -0
  33. librebots_hub-0.1.0/src/librebots/hub/v1/stats_pb2_grpc.py +98 -0
  34. librebots_hub-0.1.0/src/librebots/hub/v1/stats_pb2_grpc.pyi +52 -0
  35. librebots_hub-0.1.0/tests/e2e/test_hub.py +56 -0
  36. librebots_hub-0.1.0/tests/test_connect.py +139 -0
  37. librebots_hub-0.1.0/tests/test_package.py +21 -0
  38. librebots_hub-0.1.0/tests/test_reason.py +74 -0
  39. librebots_hub-0.1.0/tests/typing_sample.py +9 -0
  40. librebots_hub-0.1.0/uv.lock +359 -0
@@ -0,0 +1,9 @@
1
+ bin/
2
+ .venv/
3
+ __pycache__/
4
+ .DS_Store
5
+ .idea/
6
+ .pytest_cache/
7
+ .ruff_cache/
8
+ dist/
9
+ *.egg-info/
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Libre Bots
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,37 @@
1
+ Metadata-Version: 2.5
2
+ Name: librebots-hub
3
+ Version: 0.1.0
4
+ Summary: Client for the Libre Bots hub
5
+ Project-URL: Source, https://github.com/libre-bots/hub
6
+ Author: Libre Bots
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Requires-Python: >=3.12
10
+ Requires-Dist: googleapis-common-protos
11
+ Requires-Dist: grpcio>=1.85.3
12
+ Requires-Dist: protobuf>=7.35.1
13
+ Description-Content-Type: text/markdown
14
+
15
+ # librebots-hub
16
+
17
+ The Python client for the Libre Bots hub.
18
+
19
+ ```sh
20
+ pip install librebots-hub
21
+ ```
22
+
23
+ ```python
24
+ import asyncio
25
+
26
+ from librebots.hub import connect
27
+ from librebots.hub.v1 import stats_pb2, stats_pb2_grpc
28
+
29
+
30
+ async def main() -> None:
31
+ async with connect("localhost:50051", "dev-token", tls=False) as channel:
32
+ stats = await stats_pb2_grpc.StatsServiceStub(channel).GetStats(stats_pb2.GetStatsRequest())
33
+ print(stats.total.guild_count)
34
+
35
+
36
+ asyncio.run(main())
37
+ ```
@@ -0,0 +1,23 @@
1
+ # librebots-hub
2
+
3
+ The Python client for the Libre Bots hub.
4
+
5
+ ```sh
6
+ pip install librebots-hub
7
+ ```
8
+
9
+ ```python
10
+ import asyncio
11
+
12
+ from librebots.hub import connect
13
+ from librebots.hub.v1 import stats_pb2, stats_pb2_grpc
14
+
15
+
16
+ async def main() -> None:
17
+ async with connect("localhost:50051", "dev-token", tls=False) as channel:
18
+ stats = await stats_pb2_grpc.StatsServiceStub(channel).GetStats(stats_pb2.GetStatsRequest())
19
+ print(stats.total.guild_count)
20
+
21
+
22
+ asyncio.run(main())
23
+ ```
@@ -0,0 +1,58 @@
1
+ [project]
2
+ name = "librebots-hub"
3
+ version = "0.1.0"
4
+ description = "Client for the Libre Bots hub"
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ license-files = ["LICENSE"]
8
+ authors = [{ name = "Libre Bots" }]
9
+ requires-python = ">=3.12"
10
+ dependencies = [
11
+ "grpcio>=1.85.3",
12
+ "protobuf>=7.35.1",
13
+ "googleapis-common-protos",
14
+ ]
15
+
16
+ [project.urls]
17
+ Source = "https://github.com/libre-bots/hub"
18
+
19
+ [dependency-groups]
20
+ dev = [
21
+ "grpcio-tools",
22
+ "mypy-protobuf",
23
+ # 1.85.0.20261122 needs _typeshed.FloatInt, which the newest pyright does not ship yet
24
+ "types-grpcio<1.85.0.20261122",
25
+ "grpcio-status",
26
+ "pytest",
27
+ "pytest-asyncio",
28
+ "ruff",
29
+ "pyright",
30
+ ]
31
+
32
+ [build-system]
33
+ requires = ["hatchling"]
34
+ build-backend = "hatchling.build"
35
+
36
+ [tool.hatch.build.targets.wheel]
37
+ packages = ["src/librebots"]
38
+
39
+ [tool.pytest.ini_options]
40
+ asyncio_mode = "auto"
41
+ asyncio_default_fixture_loop_scope = "function"
42
+ testpaths = ["tests"]
43
+ markers = ["e2e: tests that need a running hub"]
44
+
45
+ [tool.ruff]
46
+ line-length = 120
47
+ target-version = "py312"
48
+ extend-exclude = ["src/librebots/hub/v1"]
49
+
50
+ [tool.ruff.lint]
51
+ select = ["E", "F", "I", "UP", "B"]
52
+
53
+ [tool.pyright]
54
+ pythonVersion = "3.12"
55
+ typeCheckingMode = "strict"
56
+ include = ["src/librebots/hub", "tests"]
57
+ exclude = ["src/librebots/hub/v1"]
58
+ extraPaths = ["src"]
@@ -0,0 +1,4 @@
1
+ from librebots.hub._channel import KEEPALIVE_OPTIONS, connect
2
+ from librebots.hub._reason import reason_of
3
+
4
+ __all__ = ["KEEPALIVE_OPTIONS", "connect", "reason_of"]
@@ -0,0 +1,76 @@
1
+ from collections.abc import AsyncIterator, Callable, Sequence
2
+ from typing import Any, Final
3
+
4
+ import grpc
5
+ import grpc.aio
6
+
7
+ KEEPALIVE_OPTIONS: Final[tuple[tuple[str, int], ...]] = (
8
+ ("grpc.keepalive_time_ms", 30000),
9
+ ("grpc.keepalive_timeout_ms", 10000),
10
+ ("grpc.keepalive_permit_without_calls", 1),
11
+ ("grpc.http2.max_pings_without_data", 0),
12
+ )
13
+
14
+
15
+ ShardsSource = Callable[[], tuple[Sequence[int], int] | None]
16
+
17
+
18
+ def _with_auth(
19
+ details: grpc.aio.ClientCallDetails, token: str, shards: ShardsSource | None
20
+ ) -> grpc.aio.ClientCallDetails:
21
+ metadata = grpc.aio.Metadata(*(details.metadata or ()))
22
+ metadata.add("authorization", f"Bearer {token}")
23
+ current = shards() if shards is not None else None
24
+ if current is not None:
25
+ ids, count = current
26
+ metadata.add("libre-shards", f"{','.join(str(i) for i in sorted(set(ids)))}/{count}")
27
+ return grpc.aio.ClientCallDetails(
28
+ details.method, details.timeout, metadata, details.credentials, details.wait_for_ready
29
+ )
30
+
31
+
32
+ class _UnaryTokenInterceptor(grpc.aio.UnaryUnaryClientInterceptor):
33
+ def __init__(self, token: str, shards: ShardsSource | None) -> None:
34
+ self._token = token
35
+ self._shards = shards
36
+
37
+ async def intercept_unary_unary(
38
+ self,
39
+ continuation: Callable[[grpc.aio.ClientCallDetails, Any], Any],
40
+ client_call_details: grpc.aio.ClientCallDetails,
41
+ request: Any,
42
+ ) -> Any:
43
+ return await continuation(_with_auth(client_call_details, self._token, self._shards), request)
44
+
45
+
46
+ class _StreamTokenInterceptor(grpc.aio.UnaryStreamClientInterceptor):
47
+ def __init__(self, token: str, shards: ShardsSource | None) -> None:
48
+ self._token = token
49
+ self._shards = shards
50
+
51
+ async def intercept_unary_stream(
52
+ self,
53
+ continuation: Callable[[grpc.aio.ClientCallDetails, Any], Any],
54
+ client_call_details: grpc.aio.ClientCallDetails,
55
+ request: Any,
56
+ ) -> AsyncIterator[Any]:
57
+ return await continuation(_with_auth(client_call_details, self._token, self._shards), request)
58
+
59
+
60
+ def connect(
61
+ address: str,
62
+ token: str,
63
+ *,
64
+ tls: bool,
65
+ root_certificates: bytes | None = None,
66
+ shards: ShardsSource | None = None,
67
+ ) -> grpc.aio.Channel:
68
+ """Return a channel that adds the token and shard label to each call; tls=False sends them unencrypted."""
69
+ interceptors: list[grpc.aio.ClientInterceptor] = [
70
+ _UnaryTokenInterceptor(token, shards),
71
+ _StreamTokenInterceptor(token, shards),
72
+ ]
73
+ if tls:
74
+ credentials = grpc.ssl_channel_credentials(root_certificates=root_certificates)
75
+ return grpc.aio.secure_channel(address, credentials, options=KEEPALIVE_OPTIONS, interceptors=interceptors)
76
+ return grpc.aio.insecure_channel(address, options=KEEPALIVE_OPTIONS, interceptors=interceptors)
@@ -0,0 +1,26 @@
1
+ import grpc.aio
2
+ from google.protobuf.message import DecodeError
3
+ from google.rpc import error_details_pb2, status_pb2 # pyright: ignore[reportMissingTypeStubs]
4
+
5
+ _DOMAIN = "hub.libre-bots"
6
+ _DETAILS_KEY = "grpc-status-details-bin"
7
+
8
+
9
+ def reason_of(error: grpc.aio.AioRpcError) -> str | None:
10
+ """Return the hub reason name carried by the error, or None if there is none."""
11
+ for key, value in error.trailing_metadata() or ():
12
+ if key != _DETAILS_KEY or not isinstance(value, bytes):
13
+ continue
14
+ status = status_pb2.Status()
15
+ try:
16
+ status.ParseFromString(value)
17
+ except DecodeError:
18
+ return None
19
+ for detail in status.details:
20
+ info = error_details_pb2.ErrorInfo()
21
+ try:
22
+ if detail.Unpack(info) and info.domain == _DOMAIN:
23
+ return info.reason
24
+ except DecodeError:
25
+ continue
26
+ return None
File without changes
@@ -0,0 +1,65 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: librebots/hub/v1/guilds.proto
5
+ # Protobuf Python Version: 7.35.1
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 7,
15
+ 35,
16
+ 1,
17
+ '',
18
+ 'librebots/hub/v1/guilds.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+ from librebots.hub.v1 import shards_pb2 as librebots_dot_hub_dot_v1_dot_shards__pb2
26
+
27
+
28
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dlibrebots/hub/v1/guilds.proto\x12\x10librebots.hub.v1\x1a\x1dlibrebots/hub/v1/shards.proto\"1\n\rGuildSettings\x12\x10\n\x08guild_id\x18\x01 \x01(\x04\x12\x0e\n\x06locale\x18\x02 \x01(\t\"V\n\x12GuildJoinedRequest\x12\x10\n\x08guild_id\x18\x01 \x01(\x04\x12\x18\n\x10preferred_locale\x18\x02 \x01(\t\x12\x14\n\x0cmember_count\x18\x03 \x01(\r\"H\n\x13GuildJoinedResponse\x12\x31\n\x08settings\x18\x01 \x01(\x0b\x32\x1f.librebots.hub.v1.GuildSettings\"$\n\x10GuildLeftRequest\x12\x10\n\x08guild_id\x18\x01 \x01(\x04\"\x13\n\x11GuildLeftResponse\"O\n\x0bSyncedGuild\x12\x10\n\x08guild_id\x18\x01 \x01(\x04\x12\x14\n\x0cmember_count\x18\x02 \x01(\r\x12\x18\n\x10preferred_locale\x18\x03 \x01(\t\"n\n\x11SyncGuildsRequest\x12*\n\x06shards\x18\x01 \x01(\x0b\x32\x1a.librebots.hub.v1.ShardSet\x12-\n\x06guilds\x18\x02 \x03(\x0b\x32\x1d.librebots.hub.v1.SyncedGuild\"2\n\x12SyncGuildsResponse\x12\x0e\n\x06joined\x18\x01 \x01(\r\x12\x0c\n\x04left\x18\x02 \x01(\r\"+\n\x17GetGuildSettingsRequest\x12\x10\n\x08guild_id\x18\x01 \x01(\x04\"M\n\x18GetGuildSettingsResponse\x12\x31\n\x08settings\x18\x01 \x01(\x0b\x32\x1f.librebots.hub.v1.GuildSettings\">\n\x1aUpdateGuildSettingsRequest\x12\x10\n\x08guild_id\x18\x01 \x01(\x04\x12\x0e\n\x06locale\x18\x02 \x01(\t\"P\n\x1bUpdateGuildSettingsResponse\x12\x31\n\x08settings\x18\x01 \x01(\x0b\x32\x1f.librebots.hub.v1.GuildSettings\"G\n\x19WatchGuildSettingsRequest\x12*\n\x06shards\x18\x01 \x01(\x0b\x32\x1a.librebots.hub.v1.ShardSet\"O\n\x1aWatchGuildSettingsResponse\x12\x31\n\x08settings\x18\x01 \x01(\x0b\x32\x1f.librebots.hub.v1.GuildSettings2\xeb\x04\n\x0cGuildService\x12Z\n\x0bGuildJoined\x12$.librebots.hub.v1.GuildJoinedRequest\x1a%.librebots.hub.v1.GuildJoinedResponse\x12T\n\tGuildLeft\x12\".librebots.hub.v1.GuildLeftRequest\x1a#.librebots.hub.v1.GuildLeftResponse\x12W\n\nSyncGuilds\x12#.librebots.hub.v1.SyncGuildsRequest\x1a$.librebots.hub.v1.SyncGuildsResponse\x12i\n\x10GetGuildSettings\x12).librebots.hub.v1.GetGuildSettingsRequest\x1a*.librebots.hub.v1.GetGuildSettingsResponse\x12r\n\x13UpdateGuildSettings\x12,.librebots.hub.v1.UpdateGuildSettingsRequest\x1a-.librebots.hub.v1.UpdateGuildSettingsResponse\x12q\n\x12WatchGuildSettings\x12+.librebots.hub.v1.WatchGuildSettingsRequest\x1a,.librebots.hub.v1.WatchGuildSettingsResponse0\x01\x62\x06proto3')
29
+
30
+ _globals = globals()
31
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
32
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'librebots.hub.v1.guilds_pb2', _globals)
33
+ if not _descriptor._USE_C_DESCRIPTORS:
34
+ DESCRIPTOR._loaded_options = None
35
+ _globals['_GUILDSETTINGS']._serialized_start=82
36
+ _globals['_GUILDSETTINGS']._serialized_end=131
37
+ _globals['_GUILDJOINEDREQUEST']._serialized_start=133
38
+ _globals['_GUILDJOINEDREQUEST']._serialized_end=219
39
+ _globals['_GUILDJOINEDRESPONSE']._serialized_start=221
40
+ _globals['_GUILDJOINEDRESPONSE']._serialized_end=293
41
+ _globals['_GUILDLEFTREQUEST']._serialized_start=295
42
+ _globals['_GUILDLEFTREQUEST']._serialized_end=331
43
+ _globals['_GUILDLEFTRESPONSE']._serialized_start=333
44
+ _globals['_GUILDLEFTRESPONSE']._serialized_end=352
45
+ _globals['_SYNCEDGUILD']._serialized_start=354
46
+ _globals['_SYNCEDGUILD']._serialized_end=433
47
+ _globals['_SYNCGUILDSREQUEST']._serialized_start=435
48
+ _globals['_SYNCGUILDSREQUEST']._serialized_end=545
49
+ _globals['_SYNCGUILDSRESPONSE']._serialized_start=547
50
+ _globals['_SYNCGUILDSRESPONSE']._serialized_end=597
51
+ _globals['_GETGUILDSETTINGSREQUEST']._serialized_start=599
52
+ _globals['_GETGUILDSETTINGSREQUEST']._serialized_end=642
53
+ _globals['_GETGUILDSETTINGSRESPONSE']._serialized_start=644
54
+ _globals['_GETGUILDSETTINGSRESPONSE']._serialized_end=721
55
+ _globals['_UPDATEGUILDSETTINGSREQUEST']._serialized_start=723
56
+ _globals['_UPDATEGUILDSETTINGSREQUEST']._serialized_end=785
57
+ _globals['_UPDATEGUILDSETTINGSRESPONSE']._serialized_start=787
58
+ _globals['_UPDATEGUILDSETTINGSRESPONSE']._serialized_end=867
59
+ _globals['_WATCHGUILDSETTINGSREQUEST']._serialized_start=869
60
+ _globals['_WATCHGUILDSETTINGSREQUEST']._serialized_end=940
61
+ _globals['_WATCHGUILDSETTINGSRESPONSE']._serialized_start=942
62
+ _globals['_WATCHGUILDSETTINGSRESPONSE']._serialized_end=1021
63
+ _globals['_GUILDSERVICE']._serialized_start=1024
64
+ _globals['_GUILDSERVICE']._serialized_end=1643
65
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,313 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ """
5
+
6
+ from collections import abc as _abc
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import message as _message
9
+ from google.protobuf.internal import containers as _containers
10
+ from librebots.hub.v1 import shards_pb2 as _shards_pb2
11
+ import builtins as _builtins
12
+ import sys
13
+ import typing as _typing
14
+
15
+ if sys.version_info >= (3, 11):
16
+ from typing import TypeAlias as _TypeAlias, Never as _Never
17
+ else:
18
+ from typing_extensions import TypeAlias as _TypeAlias, Never as _Never
19
+
20
+ DESCRIPTOR: _descriptor.FileDescriptor
21
+
22
+ @_typing.final
23
+ class GuildSettings(_message.Message):
24
+ DESCRIPTOR: _descriptor.Descriptor
25
+
26
+ GUILD_ID_FIELD_NUMBER: _builtins.int
27
+ LOCALE_FIELD_NUMBER: _builtins.int
28
+ guild_id: _builtins.int
29
+ locale: _builtins.str
30
+ def __init__(
31
+ self,
32
+ *,
33
+ guild_id: _builtins.int = ...,
34
+ locale: _builtins.str = ...,
35
+ ) -> None: ...
36
+ _HasFieldArgType: _TypeAlias = _Never # noqa: Y015
37
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
38
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["guild_id", b"guild_id", "locale", b"locale"] # noqa: Y015
39
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
40
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
41
+
42
+ Global___GuildSettings: _TypeAlias = GuildSettings # noqa: Y015
43
+
44
+ @_typing.final
45
+ class GuildJoinedRequest(_message.Message):
46
+ DESCRIPTOR: _descriptor.Descriptor
47
+
48
+ GUILD_ID_FIELD_NUMBER: _builtins.int
49
+ PREFERRED_LOCALE_FIELD_NUMBER: _builtins.int
50
+ MEMBER_COUNT_FIELD_NUMBER: _builtins.int
51
+ guild_id: _builtins.int
52
+ preferred_locale: _builtins.str
53
+ member_count: _builtins.int
54
+ def __init__(
55
+ self,
56
+ *,
57
+ guild_id: _builtins.int = ...,
58
+ preferred_locale: _builtins.str = ...,
59
+ member_count: _builtins.int = ...,
60
+ ) -> None: ...
61
+ _HasFieldArgType: _TypeAlias = _Never # noqa: Y015
62
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
63
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["guild_id", b"guild_id", "member_count", b"member_count", "preferred_locale", b"preferred_locale"] # noqa: Y015
64
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
65
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
66
+
67
+ Global___GuildJoinedRequest: _TypeAlias = GuildJoinedRequest # noqa: Y015
68
+
69
+ @_typing.final
70
+ class GuildJoinedResponse(_message.Message):
71
+ DESCRIPTOR: _descriptor.Descriptor
72
+
73
+ SETTINGS_FIELD_NUMBER: _builtins.int
74
+ @_builtins.property
75
+ def settings(self) -> Global___GuildSettings: ...
76
+ def __init__(
77
+ self,
78
+ *,
79
+ settings: Global___GuildSettings | None = ...,
80
+ ) -> None: ...
81
+ _HasFieldArgType: _TypeAlias = _typing.Literal["settings", b"settings"] # noqa: Y015
82
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
83
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["settings", b"settings"] # noqa: Y015
84
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
85
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
86
+
87
+ Global___GuildJoinedResponse: _TypeAlias = GuildJoinedResponse # noqa: Y015
88
+
89
+ @_typing.final
90
+ class GuildLeftRequest(_message.Message):
91
+ DESCRIPTOR: _descriptor.Descriptor
92
+
93
+ GUILD_ID_FIELD_NUMBER: _builtins.int
94
+ guild_id: _builtins.int
95
+ def __init__(
96
+ self,
97
+ *,
98
+ guild_id: _builtins.int = ...,
99
+ ) -> None: ...
100
+ _HasFieldArgType: _TypeAlias = _Never # noqa: Y015
101
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
102
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["guild_id", b"guild_id"] # noqa: Y015
103
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
104
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
105
+
106
+ Global___GuildLeftRequest: _TypeAlias = GuildLeftRequest # noqa: Y015
107
+
108
+ @_typing.final
109
+ class GuildLeftResponse(_message.Message):
110
+ DESCRIPTOR: _descriptor.Descriptor
111
+
112
+ def __init__(
113
+ self,
114
+ ) -> None: ...
115
+ _HasFieldArgType: _TypeAlias = _Never # noqa: Y015
116
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
117
+ _ClearFieldArgType: _TypeAlias = _Never # noqa: Y015
118
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
119
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
120
+
121
+ Global___GuildLeftResponse: _TypeAlias = GuildLeftResponse # noqa: Y015
122
+
123
+ @_typing.final
124
+ class SyncedGuild(_message.Message):
125
+ DESCRIPTOR: _descriptor.Descriptor
126
+
127
+ GUILD_ID_FIELD_NUMBER: _builtins.int
128
+ MEMBER_COUNT_FIELD_NUMBER: _builtins.int
129
+ PREFERRED_LOCALE_FIELD_NUMBER: _builtins.int
130
+ guild_id: _builtins.int
131
+ member_count: _builtins.int
132
+ preferred_locale: _builtins.str
133
+ def __init__(
134
+ self,
135
+ *,
136
+ guild_id: _builtins.int = ...,
137
+ member_count: _builtins.int = ...,
138
+ preferred_locale: _builtins.str = ...,
139
+ ) -> None: ...
140
+ _HasFieldArgType: _TypeAlias = _Never # noqa: Y015
141
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
142
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["guild_id", b"guild_id", "member_count", b"member_count", "preferred_locale", b"preferred_locale"] # noqa: Y015
143
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
144
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
145
+
146
+ Global___SyncedGuild: _TypeAlias = SyncedGuild # noqa: Y015
147
+
148
+ @_typing.final
149
+ class SyncGuildsRequest(_message.Message):
150
+ DESCRIPTOR: _descriptor.Descriptor
151
+
152
+ SHARDS_FIELD_NUMBER: _builtins.int
153
+ GUILDS_FIELD_NUMBER: _builtins.int
154
+ @_builtins.property
155
+ def shards(self) -> _shards_pb2.ShardSet: ...
156
+ @_builtins.property
157
+ def guilds(self) -> _containers.RepeatedCompositeFieldContainer[Global___SyncedGuild]: ...
158
+ def __init__(
159
+ self,
160
+ *,
161
+ shards: _shards_pb2.ShardSet | None = ...,
162
+ guilds: _abc.Iterable[Global___SyncedGuild] | None = ...,
163
+ ) -> None: ...
164
+ _HasFieldArgType: _TypeAlias = _typing.Literal["shards", b"shards"] # noqa: Y015
165
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
166
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["guilds", b"guilds", "shards", b"shards"] # noqa: Y015
167
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
168
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
169
+
170
+ Global___SyncGuildsRequest: _TypeAlias = SyncGuildsRequest # noqa: Y015
171
+
172
+ @_typing.final
173
+ class SyncGuildsResponse(_message.Message):
174
+ DESCRIPTOR: _descriptor.Descriptor
175
+
176
+ JOINED_FIELD_NUMBER: _builtins.int
177
+ LEFT_FIELD_NUMBER: _builtins.int
178
+ joined: _builtins.int
179
+ left: _builtins.int
180
+ def __init__(
181
+ self,
182
+ *,
183
+ joined: _builtins.int = ...,
184
+ left: _builtins.int = ...,
185
+ ) -> None: ...
186
+ _HasFieldArgType: _TypeAlias = _Never # noqa: Y015
187
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
188
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["joined", b"joined", "left", b"left"] # noqa: Y015
189
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
190
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
191
+
192
+ Global___SyncGuildsResponse: _TypeAlias = SyncGuildsResponse # noqa: Y015
193
+
194
+ @_typing.final
195
+ class GetGuildSettingsRequest(_message.Message):
196
+ DESCRIPTOR: _descriptor.Descriptor
197
+
198
+ GUILD_ID_FIELD_NUMBER: _builtins.int
199
+ guild_id: _builtins.int
200
+ def __init__(
201
+ self,
202
+ *,
203
+ guild_id: _builtins.int = ...,
204
+ ) -> None: ...
205
+ _HasFieldArgType: _TypeAlias = _Never # noqa: Y015
206
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
207
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["guild_id", b"guild_id"] # noqa: Y015
208
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
209
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
210
+
211
+ Global___GetGuildSettingsRequest: _TypeAlias = GetGuildSettingsRequest # noqa: Y015
212
+
213
+ @_typing.final
214
+ class GetGuildSettingsResponse(_message.Message):
215
+ DESCRIPTOR: _descriptor.Descriptor
216
+
217
+ SETTINGS_FIELD_NUMBER: _builtins.int
218
+ @_builtins.property
219
+ def settings(self) -> Global___GuildSettings: ...
220
+ def __init__(
221
+ self,
222
+ *,
223
+ settings: Global___GuildSettings | None = ...,
224
+ ) -> None: ...
225
+ _HasFieldArgType: _TypeAlias = _typing.Literal["settings", b"settings"] # noqa: Y015
226
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
227
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["settings", b"settings"] # noqa: Y015
228
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
229
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
230
+
231
+ Global___GetGuildSettingsResponse: _TypeAlias = GetGuildSettingsResponse # noqa: Y015
232
+
233
+ @_typing.final
234
+ class UpdateGuildSettingsRequest(_message.Message):
235
+ DESCRIPTOR: _descriptor.Descriptor
236
+
237
+ GUILD_ID_FIELD_NUMBER: _builtins.int
238
+ LOCALE_FIELD_NUMBER: _builtins.int
239
+ guild_id: _builtins.int
240
+ locale: _builtins.str
241
+ def __init__(
242
+ self,
243
+ *,
244
+ guild_id: _builtins.int = ...,
245
+ locale: _builtins.str = ...,
246
+ ) -> None: ...
247
+ _HasFieldArgType: _TypeAlias = _Never # noqa: Y015
248
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
249
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["guild_id", b"guild_id", "locale", b"locale"] # noqa: Y015
250
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
251
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
252
+
253
+ Global___UpdateGuildSettingsRequest: _TypeAlias = UpdateGuildSettingsRequest # noqa: Y015
254
+
255
+ @_typing.final
256
+ class UpdateGuildSettingsResponse(_message.Message):
257
+ DESCRIPTOR: _descriptor.Descriptor
258
+
259
+ SETTINGS_FIELD_NUMBER: _builtins.int
260
+ @_builtins.property
261
+ def settings(self) -> Global___GuildSettings: ...
262
+ def __init__(
263
+ self,
264
+ *,
265
+ settings: Global___GuildSettings | None = ...,
266
+ ) -> None: ...
267
+ _HasFieldArgType: _TypeAlias = _typing.Literal["settings", b"settings"] # noqa: Y015
268
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
269
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["settings", b"settings"] # noqa: Y015
270
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
271
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
272
+
273
+ Global___UpdateGuildSettingsResponse: _TypeAlias = UpdateGuildSettingsResponse # noqa: Y015
274
+
275
+ @_typing.final
276
+ class WatchGuildSettingsRequest(_message.Message):
277
+ DESCRIPTOR: _descriptor.Descriptor
278
+
279
+ SHARDS_FIELD_NUMBER: _builtins.int
280
+ @_builtins.property
281
+ def shards(self) -> _shards_pb2.ShardSet: ...
282
+ def __init__(
283
+ self,
284
+ *,
285
+ shards: _shards_pb2.ShardSet | None = ...,
286
+ ) -> None: ...
287
+ _HasFieldArgType: _TypeAlias = _typing.Literal["shards", b"shards"] # noqa: Y015
288
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
289
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["shards", b"shards"] # noqa: Y015
290
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
291
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
292
+
293
+ Global___WatchGuildSettingsRequest: _TypeAlias = WatchGuildSettingsRequest # noqa: Y015
294
+
295
+ @_typing.final
296
+ class WatchGuildSettingsResponse(_message.Message):
297
+ DESCRIPTOR: _descriptor.Descriptor
298
+
299
+ SETTINGS_FIELD_NUMBER: _builtins.int
300
+ @_builtins.property
301
+ def settings(self) -> Global___GuildSettings: ...
302
+ def __init__(
303
+ self,
304
+ *,
305
+ settings: Global___GuildSettings | None = ...,
306
+ ) -> None: ...
307
+ _HasFieldArgType: _TypeAlias = _typing.Literal["settings", b"settings"] # noqa: Y015
308
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
309
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["settings", b"settings"] # noqa: Y015
310
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
311
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
312
+
313
+ Global___WatchGuildSettingsResponse: _TypeAlias = WatchGuildSettingsResponse # noqa: Y015