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) -> booljava
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
| Attribute | Type | Description |
|---|---|---|
type | GameUpdateType.DisplayChatEvent | The type of game update, which is always DisplayChatEvent for this class. |
key | string | The key of the Quick Chat message. Find a reference of valid keys in the Controller documentation. |
category | string | The category of the Quick Chat message. Find a reference of valid categories in the Controller documentation. |
target | PlayerID or None/null | Some Quick Chat messages refer to a specific player, for example "attack target!". Those messages will have a value for this attribute. |
playerID | PlayerSmallID or None/null | The small player ID of the sender of the Quick Chat message. |
isFrom | bool | Don't worry too much about this attribute. |
recipient | PlayerID | The player ID of the recipient of the Quick Chat message. |
Methods
equals
python
def equals(full: str) -> boolHelper 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:
| Category | Key | Requires Target? | Official description |
|---|---|---|---|
help | troops | No | Please give me troops! |
help | troops_frontlines | No | Send troops to the frontlines! |
help | gold | No | Please give me gold! |
help | no_attack | No | Please don't attack me! |
help | sorry_attack | No | Sorry, I didn't mean to attack. |
help | alliance | No | Alliance? |
help | help_defend | Yes | Help me defend against target! |
help | trade_partners | No | Let's be trade partners! |
attack | attack | Yes | Attack target! |
attack | mirv | Yes | Launch a MIRV at target! |
attack | focus | Yes | Focus fire on target! |
attack | finish | Yes | Let's finish off target! |
attack | build_warships | No | Build warships! |
defend | defend | Yes | Defend target! |
defend | defend_from | Yes | Defend from target! |
defend | dont_attack | Yes | Don't attack target! |
defend | ally | Yes | target is my ally! |
defend | build_posts | No | Build Defense Posts! |
greet | hello | No | Hello! |
greet | good_job | No | Good job! |
greet | good_luck | No | Good luck! |
greet | have_fun | No | Have fun! |
greet | gg | No | GG! |
greet | nice_to_meet | No | Nice to meet you! |
greet | well_played | No | Well played! |
greet | hi_again | No | Hi again! |
greet | bye | No | Bye! |
greet | thanks | No | Thanks! |
greet | oops | No | Oops, wrong button! |
greet | trust_me | No | You can trust me. Promise! |
greet | trust_broken | No | I trusted you... |
greet | ruining_games | No | You're ruining both of our games. |
greet | dont_do_that | No | Don't do that! |
greet | same_team | No | I'm on your side! |
misc | go | No | Let's go! |
misc | strategy | No | Nice strategy! |
misc | fun | No | This game is fun! |
misc | team_up | Yes | Let's team up against target! |
misc | pr | No | When will my PR finally get merged...? |
misc | build_closer | No | Build closer to get trains! |
misc | coastline | No | Please let me get a coastline. |
warnings | strong | Yes | target is strong. |
warnings | weak | Yes | target is weak. |
warnings | mirv_soon | Yes | target can launch a MIRV soon! |
warnings | number1_warning | No | The #1 player will win soon unless we team up! |
warnings | stalemate | No | Let's make peace. This is a stalemate, we will both lose. |
warnings | has_allies | Yes | target has many allies. |
warnings | no_allies | Yes | target has no allies. |
warnings | betrayed | Yes | target betrayed their ally! |
warnings | betrayed_me | Yes | target betrayed me! |
warnings | getting_big | Yes | target is growing too fast! |
warnings | danger_base | Yes | target is unprotected! |
warnings | saving_for_mirv | Yes | target is saving up to launch a MIRV. |
warnings | mirv_ready | Yes | target has enough gold to launch a MIRV! |
warnings | snowballing | Yes | target is snowballing too fast! |
warnings | cheating | Yes | target is cheating! |
warnings | stop_trading | Yes | Stop trading with target! |
