# #chat

## Description

\#chat channel

This is a special type of #event which watches the specified channel. Content from the channel is accessed by creating a Sub Event\_Chat.

## Use

Valid channels are: auc, *chat*, guild, group, raid, ooc, say, shout, and tell. (*chat* represents channels)

Only one channel may be used on the #chat line, however multiple lines may be added.

## Example

```
#chat guild
#chat group

Sub Event_Chat(Channel,Sender,Text)
  /echo ${Sender} told me ${Text} in ${Channel}
/return
```

This would trigger Event\_Chat for both guild and group chat.

```
/if (${Text.Find[send me to]} && ${Select[${Me.Class.ShortName},DRU,WIZ]}) {
  /call SendUs ${Text.Arg[4]} ${Sender}
  /return
}
```

This would watch for the key phrase "send me to" and then call the subroutine SendUs with the keyword following the phrase.

Ex "/g send me to pok" would man the keyword was pok, and the subroutine would cast the appropriate spell to send you to Plane of Knowledge.

```
/if (${Text.Find[open door]} || ${Text.Find[click door]}) {
  /doortarget
  /delay 1s
  /face door
  /if (${DoorTarget.Distance}>20) {
    /click left door
  }
}
```

In this instance the macro would watch for the key phrase "open door" or "click door" and, provide the door was with in twenty feet, click on the door.

Also see here for information on #events and the #chat special event.

## See Also

* [Pound\_Commands](/macroquest/commands/macro-commands/macro-directives.md)
* [Macro\_Reference](/macroquest/documentation/macro-reference.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://macroquest.gitbook.io/macroquest/commands/macro-commands/macro-directives/chat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
