> For the complete documentation index, see [llms.txt](https://wiki.stmod.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.stmod.net/private-servers/chatting.md).

# Chatting

<figure><img src="https://1662484209-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSrVu0j9CYXbvJXRYgHnk%2Fuploads%2Fgit-blob-536582beec78d1e6212172722e38ef4df3b3a76a%2Fchatting-tab-main.png?alt=media" alt="Chatting tab"><figcaption><p>Chatting tab (build v250926)</p></figcaption></figure>

The **Chatting** tab lets you automatically send repeated messages in the game chat. Configure the following options:

* **Text field** — Type the message you want to spam.
* **Delete text** — Clear the current text from the input field.
* **Delay** — Set how frequently (in seconds) the message is sent.
* **Color** — Choose the color your message will appear in.
* **Type** — Select the chat channel to send your message through:
  * **Chat** — Standard local chat
  * **Shout** — Server-wide shout channel
  * **PM** — Private message
  * **Merchant** — Merchant chat *(not available on all servers)*
* **Start** / **Stop** — Starts or stops the repeating spam.
* **Send text once** — Sends the current text a single time without starting the repeating loop.

***

**`Chatting tab → Auto-Reply`**

<figure><img src="https://1662484209-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSrVu0j9CYXbvJXRYgHnk%2Fuploads%2Fgit-blob-105f86815aa07d64b4c75b3509f0c26e25e97e8a%2Fchatting-auto-reply.png?alt=media" alt="Auto-Reply sub-tab"><figcaption></figcaption></figure>

The **Auto-Reply** sub-tab allows you to set up an automated reply bot that responds to incoming messages based on keyword rules — or, optionally, using AI.

* **If word / phrase found** — Enter the keyword or phrase you want the bot to watch for in incoming messages.
* **Reply with** — Enter the message the bot should send when a match is found.

  **Example:** If you add the rule `hello → hi`, the bot will behave like this:

  ```
  PlayerX: hello
  STMod: hi
  ```
* **Add answer** — Adds the trigger/reply pair you just typed to the **Current replies list**.
* **Enable auto-reply bot** — Toggle this on to activate the reply bot.
* **Reply back in X seconds** — Set how long the bot waits before sending its reply to the sender.
* **Reply times** — Limits how many times the bot will reply to the same message/sender, to avoid loops with other bots.
* **AI reply** — Instead of (or alongside) your keyword list, lets an AI model generate the reply text based on the incoming message.

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>AI reply needs your own Groq API key. The first time you enable it, STMod will offer to open <code>STMod/Data/groq_api_key.txt</code> so you can paste your key in — get a free key from <a href="https://console.groq.com/">Groq's console</a> and save it into that file. STMod does not provide this key for you.</p></div>
* **Current replies list** — Displays all of your active keyword-to-reply rules. Use **Delete** to remove a selected entry.
* **Reply with '?' if unknown message** — If the incoming message does not match any rule in your reply list, the bot replies with `??`.

  **Example** — given the reply list:

  ```
  abc → bca
  hey → hi
  ```

  ```
  PlayerX: hi there
  STMod: ??
  ```
* **Repeat previous message if unknown message** — If the incoming message does not match any rule, the bot echoes back the last message it received instead.

  **Example** — given the same reply list:

  ```
  PlayerX: hi there
  STMod: hi there
  ```
