This skill should be used when creating chat messages, sending roll results to chat, configuring speakers, implementing whispers and roll modes, or hooking into chat message rendering.
View on GitHubImproperSubset/hh-agentics
fvtt-dev
fvtt-dev/skills/fvtt-chat-messages/SKILL.md
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/ImproperSubset/hh-agentics/blob/main/fvtt-dev/skills/fvtt-chat-messages/SKILL.md -a claude-code --skill fvtt-chat-messagesInstallation paths:
.claude/skills/fvtt-chat-messages/# Foundry VTT Chat Messages
**Domain:** Foundry VTT Module/System Development
**Status:** Production-Ready
**Last Updated:** 2026-01-05
## Overview
ChatMessage documents display in the chat log and handle rolls, whispers, and player communication. Understanding message creation and hooks is essential for game system features.
### When to Use This Skill
- Creating chat messages programmatically
- Sending dice roll results to chat
- Configuring message speakers
- Implementing whispers and roll modes
- Adding custom rendering to messages
## ChatMessage Structure
### Core Fields
```javascript
{
_id: "documentId",
author: "userId", // Who created the message
content: "<p>HTML</p>", // Message content
flavor: "Roll description", // Flavor text for rolls
speaker: { // Who is "speaking"
scene: "sceneId",
actor: "actorId",
token: "tokenId",
alias: "Display Name"
},
whisper: ["userId"], // Private recipients
blind: false, // GM-only visibility
rolls: [], // Dice roll data
sound: "audio/path.ogg", // Sound to play
flags: {} // Custom data
}
```
## Creating Messages
### Simple Text Message
```javascript
await ChatMessage.create({
content: "Hello, world!"
});
```
### Message with Speaker
```javascript
await ChatMessage.create({
content: "I attack the dragon!",
speaker: ChatMessage.getSpeaker({ actor: myActor })
});
```
### HTML Content
```javascript
await ChatMessage.create({
content: `
<h2>Critical Hit!</h2>
<p>You deal <strong>24</strong> damage.</p>
`,
speaker: ChatMessage.getSpeaker({ token: myToken })
});
```
### With Custom Flags
```javascript
await ChatMessage.create({
content: "Attack roll",
flags: {
"my-module": {
rollType: "attack",
targetId: target.id
}
}
});
```
## Roll Messages
### Using Roll.toMessage() (Recommended)
```javascript
const roll = new Roll("1d20 + @mod", { mod: