|
7 | 7 | from config import settings |
8 | 8 |
|
9 | 9 | if TYPE_CHECKING: |
10 | | - from collections.abc import AsyncIterable, Sequence |
| 10 | + from collections.abc import AsyncIterable, Mapping, Sequence |
11 | 11 |
|
12 | 12 |
|
13 | 13 | __all__: "Sequence[str]" = ("get_channel_message_counts", "get_server_message_counts") |
14 | 14 |
|
15 | 15 |
|
16 | | -async def get_channel_message_counts(channel: discord.TextChannel) -> dict[str, int]: |
| 16 | +async def get_channel_message_counts(channel: discord.TextChannel) -> "Mapping[str, int]": |
17 | 17 | """ |
18 | 18 | Get the message counts for each role in the given channel. |
19 | 19 |
|
@@ -62,14 +62,14 @@ async def get_channel_message_counts(channel: discord.TextChannel) -> dict[str, |
62 | 62 |
|
63 | 63 | async def get_server_message_counts( |
64 | 64 | guild: discord.Guild, *, guest_role: discord.Role |
65 | | -) -> dict[str, dict[str, int]]: |
| 65 | +) -> "Mapping[str, Mapping[str, int]]": |
66 | 66 | """ |
67 | 67 | Get the message counts for each channel in the given server. |
68 | 68 |
|
69 | | - The message counts are stored in a mapping. It contains a key "roles" which is |
| 69 | + The message counts are stored in a mapping. It contains a key "roles", which is |
70 | 70 | a mapping of role names (prefixed by `@`) to the message counts |
71 | 71 | for each role across the entire server. |
72 | | - The mapping also contains a key "channels" which is a mapping with the channel |
| 72 | + The mapping also contains a key "channels", which is a mapping with the channel |
73 | 73 | name as a key and the number of messages sent in that channel as the value. |
74 | 74 | The "roles" sub-mapping also includes a "Total" key for the total number of messages. |
75 | 75 | """ |
|
0 commit comments