Skip to content

Latest commit

 

History

History
109 lines (84 loc) · 3.06 KB

File metadata and controls

109 lines (84 loc) · 3.06 KB

Your first bot

This page walks through getting the first channel bot answering messages. Pick the platform you actually use; each section is self-contained.

::: tip Prerequisites You should already have:

  • garyx --version working (Installation)
  • the gateway running (garyx status returns OK)
  • at least one provider logged in (Providers) :::

Telegram

The fastest path. You only need a bot token from @BotFather.

  1. Talk to @BotFather, /newbot, follow prompts, and store the token in your shell environment.

  2. Register the account with Garyx and bind it to an agent:

    export TELEGRAM_BOT_TOKEN="TOKEN_FROM_BOTFATHER"
    garyx channels add telegram main \
      --token "$TELEGRAM_BOT_TOKEN" \
      --agent-id claude
    garyx gateway restart --no-wake
  3. DM your bot. Garyx pulls updates with long-polling and routes them through the agent you bound on --agent-id.

::: info Group chats By default the bot will only listen in DMs. To enable a group, edit the account in ~/.garyx/garyx.json and add the chat under channels.telegram.accounts.<id>.config.groups. See Configuration → Telegram for the schema. :::

Feishu / Lark

Use the device-flow login if you do not have an app yet:

garyx channels login feishu --domain feishu   # use --domain lark for 海外
garyx gateway restart --no-wake

The login flow walks you through creating an app and writes the resulting app_id / app_secret back into garyx.json.

If you already have an app, register it directly:

garyx channels add feishu gary \
  --app-id cli_xxxxxxxx \
  --app-secret xxxxxxxxxxxx \
  --domain feishu \
  --agent-id claude

The gateway opens a Feishu WebSocket; @-mention the bot in any chat it has been added to.

WeChat (企业微信 / 个人号 via ilinkai)

garyx channels login weixin
garyx gateway restart --no-wake

The login flow scans a QR code in your terminal and writes the resulting token and uin back into garyx.json.

What the resulting config looks like

After adding the Telegram example above, the relevant slice of garyx.json will look like this:

{
  "channels": {
    "telegram": {
      "accounts": {
        "main": {
          "enabled": true,
          "agent_id": "claude",
          "config": {
            "token": "${TELEGRAM_BOT_TOKEN}"
          }
        }
      }
    }
  }
}

Built-in channels (telegram, feishu, weixin, api) sit directly under channels.<channel_id>. Each account has an envelope (enabled, name, agent_id, workspace_dir) plus a channel-specific config blob — see Concepts → Channels for why.

Where to go next