Skip to content

Commit f4dffd5

Browse files
authored
Merge pull request #141 from MagicTheDev/patch-1
Add Required Townhall to clan class
2 parents 38d0845 + 670dee8 commit f4dffd5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

coc/clans.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ class Clan(BaseClan):
107107
The clan's versus trophy count. This is calculated according to members' versus trophy counts.
108108
required_trophies: :class:`int`
109109
The minimum trophies required to apply to this clan.
110+
required_townhall: :class:`int`
111+
The minimum townhall level required to apply to this clan.
110112
war_frequency: :class:`str`
111113
The frequency for when this clan goes to war.
112114
For example, this could be ``always``.
@@ -159,6 +161,7 @@ class Clan(BaseClan):
159161
"capital_district_cls",
160162
"war_league",
161163
"chat_language",
164+
"required_townhall",
162165

163166
"_cs_labels",
164167
"_cs_members",
@@ -197,6 +200,7 @@ def _from_data(self, data: dict) -> None:
197200
self.description: str = data_get("description")
198201
self.war_league = try_enum(WarLeague, data=data_get("warLeague"))
199202
self.chat_language = try_enum(ChatLanguage, data=data_get("chatLanguage"))
203+
self.required_townhall = data_get("requiredTownhallLevel")
200204

201205
label_cls = self.label_cls
202206
self._iter_labels = (label_cls(data=ldata, client=self._client) for ldata in data_get("labels", []))

0 commit comments

Comments
 (0)