Skip to content

Auto-roles

Auto-roles keep your server’s Discord roles in lockstep with your members’ Clash accounts. Assign a role to a Town Hall level, a trophy league, or a clan rank, and ClashDuke applies it automatically to every linked member — and can rewrite nicknames from a template at the same time.

Subcommand Purpose
/autorole town-hall Role for a Town Hall level
/autorole builder-hall Role for a Builder Hall level
/autorole leagues Roles by trophy (home) league
/autorole builder-leagues Roles by builder-base league
/autorole clan-roles Leadership / membership roles for a clan
/autorole family Family + verified roles
/autorole wars Role for members in a clan’s current war
/autorole nickname Auto-set nicknames from a template
/autorole config Behaviour settings (nightly re-sync)
/autorole disable Clear a configured autorole type
/autorole list Show configured autoroles
/autorole refresh Re-evaluate and apply roles for a member
/autorole town-hall — by Town Hall

Options: level (required, 1–18), role (required). Members at that Town Hall get the role.

/autorole town-hall level:17 role:@TH17
/autorole builder-hall — by Builder Hall

Options: level (required, 1–10), role (required).

/autorole leagues — by trophy league

One role option per league: bronze, silver, gold, crystal, master, champion, titan, legend. Provide at least one.

/autorole leagues legend:@Legend titan:@Titan champion:@Champion
/autorole builder-leagues — by builder-base league

One role option per tier: wood, clay, stone, copper, brass, iron, steel, titanium, platinum, emerald, ruby, diamond.

/autorole clan-roles — by clan rank

Options: clan (required, autocomplete), leader, co_leader, elder, member, everyone (anyone in this clan). Set only the ranks you want mapped.

/autorole clan-roles clan:#2PP0JCCL leader:@Leader co_leader:@Co elder:@Elder member:@Member
/autorole family — family & verified

Options: family_role (anyone in any linked clan), verified_role (anyone with an API-verified account), only_verified (require verification for clan/family roles).

/autorole wars — current-war role

Options: clan (required, autocomplete), role (required). Members in the clan’s active war get the role, synced each war tick and removed when the war ends.

/autorole nickname rewrites member nicknames from a template. Two templates are supported: one for members in a linked clan (family) and one for members not in a linked clan.

change_nicknamesboolean

Turn auto-nicknaming on or off.

family_formatstring

Template for members in a linked clan, e.g. {NAME} | {TH} | {ROLE}. Pass none to clear.

non_family_formatstring

Template for members not in a linked clan, e.g. {NAME} | {TH}. Pass none to clear.

Variable Meaning
{NAME} In-game player name (also {PLAYER_NAME})
{TH} Town Hall level (also {TOWN_HALL})
{TH_SMALL} Town Hall as a superscript (also {TOWN_HALL_SMALL})
{ROLE} Clan rank label (also {CLAN_ROLE})
{CLAN} Clan name (also {CLAN_NAME})
{ALIAS} Clan alias, falls back to the clan name (also {CLAN_ALIAS}, {ALIASES})
{DISCORD} The member’s Discord display name (also {DISCORD_NAME})
{USERNAME} The member’s Discord username (also {DISCORD_USERNAME})
/autorole nickname change_nicknames:true family_format:{NAME} | {TH_SMALL} {ROLE}
Configure your mappings

Set up any combination of TH, league, clan, family, war, and nickname rules above.

Enable nightly re-sync (optional)

/autorole config auto_update_roles:true re-applies roles and nicknames for every linked member each night.

Refresh on demand

/autorole refresh re-evaluates one member (defaults to you). It reports how many roles were added, removed, or skipped (with the reason — e.g. a role above ClashDuke’s own).

/autorole list shows everything currently configured. /autorole disable type:<...> clears a whole category: Town Hall, Builder Hall, Clan roles, or Family / Verified.

/role-users

List every member who currently holds a given Discord role — pass role (required). Handy for auditing what an auto-role granted.

Self-serve panel

/setup buttons posts a panel with a Refresh My Roles button so members can re-sync their own roles instantly.