Packages

An extended and functional wrapper for the Clash of Clans API

Current section

Files

Jump to
clashofclans lib endpoints clans wars warleague.ex
Raw

lib/endpoints/clans/wars/warleague.ex

defmodule Endpoints.Clans.Wars.Warleague do
alias Endpoints.Clans.Raw
def get_clan_war_league_name(clantag) do
with {:ok, clan} <- Raw.get_raw_clan_information(clantag) do
Map.take(clan, ["warLeague"])
|> Map.values()
|> hd()
|> Map.take(["name"])
|> Map.values()
|> hd()
end
end
end