Skip to content

DisplayChatMessageUpdate

python
class DisplayChatMessageUpdate(BaseModel):
    type: Literal[GameUpdateType.DisplayChatEvent]
    key: str
    category: str
    target: Optional[PlayerID] = None
    playerID: Optional[PlayerSmallID]
    isFrom: bool
    recipient: PlayerID

    def equals(full: str) -> bool
java
public class DisplayChatMessageUpdate {
    public int type;
    @NotNull public String key;
    @NotNull public String category;
    @Nullable public PlayerID target;
    @Nullable public PlayerSmallID playerID;
    public boolean isFrom;
    @NotNull public PlayerID recipient;

    public boolean equals(@NotNull String full)
}

Encapsulates event data when a Quick Chat message is received in the game.

The "parent" type is RelevantGameUpdate, which includes all game update types that are relevant to the bot's decision-making process in the ConquerHack event.

You can check whether this event is relevant to your bot by looking at the recipient attribute to see if it matches your bot's player ID, in addition to the isFrom attribute being false. Or you can use the update_is_for_me utility function.

Attributes

AttributeTypeDescription
typeGameUpdateType.DisplayChatEventThe type of game update, which is always DisplayChatEvent for this class.
keystringThe key of the Quick Chat message. Find a reference of valid keys in the Controller documentation.
categorystringThe category of the Quick Chat message. Find a reference of valid categories in the Controller documentation.
targetPlayerID or None/nullSome Quick Chat messages refer to a specific player, for example "attack target!". Those messages will have a value for this attribute.
playerIDPlayerSmallID or None/nullThe small player ID of the sender of the Quick Chat message.
isFromboolDon't worry too much about this attribute.
recipientPlayerIDThe player ID of the recipient of the Quick Chat message.

Methods

equals

python
def equals(full: str) -> bool

Helper function to check whether the category and key of this message match a given full Quick Chat string.

The full Quick Chat string should be in the format of category.key.

Valid Quick Chat Categories and Keys

Below are the valid categories and keys for Quick Chat:

CategoryKeyRequires Target?Official description
helptroopsNoPlease give me troops!
helptroops_frontlinesNoSend troops to the frontlines!
helpgoldNoPlease give me gold!
helpno_attackNoPlease don't attack me!
helpsorry_attackNoSorry, I didn't mean to attack.
helpallianceNoAlliance?
helphelp_defendYesHelp me defend against target!
helptrade_partnersNoLet's be trade partners!
attackattackYesAttack target!
attackmirvYesLaunch a MIRV at target!
attackfocusYesFocus fire on target!
attackfinishYesLet's finish off target!
attackbuild_warshipsNoBuild warships!
defenddefendYesDefend target!
defenddefend_fromYesDefend from target!
defenddont_attackYesDon't attack target!
defendallyYestarget is my ally!
defendbuild_postsNoBuild Defense Posts!
greethelloNoHello!
greetgood_jobNoGood job!
greetgood_luckNoGood luck!
greethave_funNoHave fun!
greetggNoGG!
greetnice_to_meetNoNice to meet you!
greetwell_playedNoWell played!
greethi_againNoHi again!
greetbyeNoBye!
greetthanksNoThanks!
greetoopsNoOops, wrong button!
greettrust_meNoYou can trust me. Promise!
greettrust_brokenNoI trusted you...
greetruining_gamesNoYou're ruining both of our games.
greetdont_do_thatNoDon't do that!
greetsame_teamNoI'm on your side!
miscgoNoLet's go!
miscstrategyNoNice strategy!
miscfunNoThis game is fun!
miscteam_upYesLet's team up against target!
miscprNoWhen will my PR finally get merged...?
miscbuild_closerNoBuild closer to get trains!
misccoastlineNoPlease let me get a coastline.
warningsstrongYestarget is strong.
warningsweakYestarget is weak.
warningsmirv_soonYestarget can launch a MIRV soon!
warningsnumber1_warningNoThe #1 player will win soon unless we team up!
warningsstalemateNoLet's make peace. This is a stalemate, we will both lose.
warningshas_alliesYestarget has many allies.
warningsno_alliesYestarget has no allies.
warningsbetrayedYestarget betrayed their ally!
warningsbetrayed_meYestarget betrayed me!
warningsgetting_bigYestarget is growing too fast!
warningsdanger_baseYestarget is unprotected!
warningssaving_for_mirvYestarget is saving up to launch a MIRV.
warningsmirv_readyYestarget has enough gold to launch a MIRV!
warningssnowballingYestarget is snowballing too fast!
warningscheatingYestarget is cheating!
warningsstop_tradingYesStop trading with target!