OpenClaw Academy · บทเรียน

โทเค็น รายชื่ออนุญาต และ requireMention

ใช้โทเค็น รายชื่ออนุญาต allowFrom และ requireMention ของกลุ่มร่วมกัน เพื่อควบคุมว่าใครบ้างที่เข้าถึงผู้ช่วยของคุณได้

บทเรียน 2 จาก 413 ขั้นตอน

โทเค็น รายชื่ออนุญาต และ requireMention เป็นบทเรียน OpenClaw Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน OpenClaw Academy และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส OpenClaw Academy มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

Three Tools, One Goal

To control who reaches your assistant, you combine three things: tokens, allowlists, and required mentions. Together they form your front line. 🔐

What Tokens Do

A token is a secret that proves a channel or client is allowed to connect to your Gateway. Keep it private, like a house key.

The allowFrom Allowlist

The allowFrom key lists exactly which senders may message OpenClaw on a channel. Anyone not listed is simply ignored.

Allowlist In Config

You set allowFrom inside your channel block. Here a WhatsApp channel only accepts one number, shown in JSON5 config.

{
  channels: {
    whatsapp: {
      allowFrom: ["+15555550123"]
    }
  }
}

Where It Lives

That config sits in ~/.openclaw/openclaw.json. Edit it, and OpenClaw enforces your allowlist the next time it handles messages.

requireMention In Groups

For group chats, requireMention tells OpenClaw to stay quiet unless it is explicitly mentioned, so it never reacts to every message.

requireMention Example

Apply requireMention to all groups with a wildcard so the assistant only speaks when called by name.

{
  channels: {
    whatsapp: {
      groups: { "*": { requireMention: true } }
    }
  }
}

Mention Patterns

Define how to call it with mentionPatterns, like @openclaw. Only messages matching a pattern count as a real mention.

{
  messages: {
    groupChat: { mentionPatterns: ["@openclaw"] }
  }
}

Layer Them Together

Each control closes a different gap. Layering tokens, allowFrom, and requireMention is far safer than relying on any single one.

Tokens For Channels

Tokens authenticate the channel connection itself, while allowFrom decides which people behind that channel are trusted to send commands.

Start Strict

A safe habit is to start strict: empty allowlists, mentions required, then add only the senders you truly need over time.

Quick Check

Match each control to what it actually limits.

Recap

Use tokens to authenticate channels, allowFrom to allow senders, and requireMention plus mentionPatterns to stay quiet until called. ✅

เริ่มต้นได้ฟรี

เรียนรู้ Bash ด้วย AI tutor — ฟรี

เขียนและเรียกใช้โค้ดจริงในเบราว์เซอร์ของคุณ รับความช่วยเหลือทันทีจาก AI tutor 24/7 และเรียนรู้ต่อจากที่คุณหยุดบนเว็บหรือในแอป

คอร์ส
10
บทเรียน
40

คำถามที่พบบ่อย

บทเรียน “โทเค็น รายชื่ออนุญาต และ requireMention” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “โทเค็น รายชื่ออนุญาต และ requireMention” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส OpenClaw Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส OpenClaw Academy มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “โทเค็น รายชื่ออนุญาต และ requireMention”

ใช้โทเค็น รายชื่ออนุญาต allowFrom และ requireMention ของกลุ่มร่วมกัน เพื่อควบคุมว่าใครบ้างที่เข้าถึงผู้ช่วยของคุณได้ คุณปฏิบัติ OpenClaw Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน OpenClaw Academy หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน OpenClaw Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน

บทเรียน “โทเค็น รายชื่ออนุญาต และ requireMention” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน OpenClaw Academy นี้ได้ไหม

ได้ บทเรียน OpenClaw Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. เหตุใดกลไกป้องกันจึงสำคัญ
  2. โทเค็น รายชื่ออนุญาต และ requireMention
  3. เอกสารความปลอดภัยของ Gateway
  4. เข้าถึงจากระยะไกลผ่าน SSH และ Tailscale
← กลับไปที่ OpenClaw Academy