📐 Tutorial 1: Create Flex Messages
บทเรียนที่ 1: สร้าง Flex Messages
Design Beautiful Flex Messages — ออกแบบ Flex Messages สวยๆ 🌱 Easy
สิ่งที่คุณจะได้เรียนรู้:
- โครงสร้างของ Flex Message (bubble, box, component)
- การใช้ Flex Message Simulator
- การสร้างการ์ดสินค้าด้วย Flex Message
- การใช้ gerunds เพื่ออธิบายสิ่งที่คุณสนุกกับการทำ
What You'll Learn:
Create your first Flex Message! You'll learn the structure of a Flex Message, how to use the simulator, and how to build a product card. Practice gerunds to describe what you enjoy doing!
1เปิด Flex Message Simulator — Open the Simulator
ไปที่ LINE Developers Console แล้วเปิด Flex Message Simulator เครื่องมือนี้ช่วยให้คุณออกแบบและดูตัวอย่าง Flex Messages ก่อนส่งจริง
English: Go to the LINE Developers Console and open the Flex Message Simulator. This tool helps you design and preview Flex Messages before sending them.
2สร้าง Product Card — Create a Product Card
สร้างการ์ดสินค้าที่มีรูปภาพ ชื่อสินค้า ราคา และปุ่มกด "Buy Now" ลองออกแบบเอง!
English: Build a product card with an image, product name, price, and a "Buy Now" button. Try designing it yourself!
3สร้าง Carousel — Create a Carousel
สร้าง carousel ที่แสดงสินค้าหลายรายการ ผู้ใช้สามารถเลื่อนซ้าย-ขวาเพื่อดูสินค้าทั้งหมด
English: Create a carousel that shows multiple products. Users can swipe left and right to see all items.
💡 Grammar Practice — ฝึกไวยากรณ์
Use gerunds when you describe this activity:
- ✅ I enjoy designing Flex Message cards.
- ✅ I finished creating my first product carousel.
- ✅ I practiced writing JSON for Flex Messages.
📱 Tutorial 2: Rich Menu & Image Responses
บทเรียนที่ 2: Rich Menu และการตอบรูปภาพ
Add Rich Menu and Image Responses — เพิ่ม Rich Menu และตอบรูปภาพ 🔍 Medium
สิ่งที่คุณจะได้เรียนรู้:
- วิธีสร้าง Rich Menu ใน LINE Official Account Manager
- การกำหนด action ให้แต่ละส่วนของ Rich Menu
- การให้บอทรับและตอบรูปภาพ
- การใช้ infinitives เพื่ออธิบายแผนและเป้าหมาย
What You'll Learn:
Create a Rich Menu for your bot and add image response capabilities. You'll learn to design menus, assign actions, and handle image messages. Practice infinitives for describing plans!
1ออกแบบ Rich Menu — Design Your Rich Menu
เตรียมรูปภาพขนาด 2500 x 1686 pixels หรือ 2500 x 843 pixels สำหรับ Rich Menu แบ่งเป็นส่วนต่างๆ ที่กดได้
English: Prepare an image sized 2500 x 1686 pixels or 2500 x 843 pixels for the Rich Menu. Divide it into tappable sections.
2สร้าง Rich Menu ผ่าน API — Create Rich Menu via API
สร้าง Rich Menu ผ่าน Messaging API เพื่อควบคุมได้มากขึ้น สามารถเปลี่ยน Rich Menu ตามผู้ใช้หรือสถานการณ์ได้
English: Create the Rich Menu through the Messaging API for more control. You can switch menus based on user or situation.
3จัดการรูปภาพจากผู้ใช้ — Handle Image Messages
เมื่อผู้ใช้ส่งรูปภาพมา บอทสามารถรับรูปแล้วส่งต่อให้ AI วิเคราะห์ เช่น บอกว่ารูปมีอะไร หรือแปลข้อความในรูป
English: When users send images, your bot can receive them and forward to AI for analysis — describe what's in the image or translate text in the image.
💡 Grammar Practice — ฝึกไวยากรณ์
Use infinitives when describing your plans:
- ✅ I want to add a Rich Menu to my bot.
- ✅ I need to create the menu image first.
- ✅ I plan to use AI for image recognition.
- ✅ I decided to design a three-section menu.
🧠 Tutorial 3: AI Customer Service Bot
บทเรียนที่ 3: บอทบริการลูกค้าด้วย AI
Build an AI Customer Service Bot — สร้างบอทบริการลูกค้า AI 🏆 Hard
สิ่งที่คุณจะได้เรียนรู้:
- วิธีเชื่อมต่อ AI (Claude/OpenAI) กับ LINE Bot
- การสร้างระบบ conversation memory (จำบริบทการสนทนา)
- การกำหนด system prompt สำหรับบริการลูกค้า
- การรวม Flex Messages กับการตอบ AI
What You'll Learn:
Build a complete AI-powered customer service bot! Connect AI APIs, add conversation memory, design system prompts, and combine Flex Messages with AI responses. This is the most challenging tutorial!
1ตั้งค่า AI API — Set Up AI API Connection
เชื่อมต่อบอท LINE ของคุณกับ AI API (เช่น Claude หรือ OpenAI) เพื่อให้บอทสามารถตอบคำถามอย่างฉลาด
English: Connect your LINE bot to an AI API (like Claude or OpenAI) so it can answer questions intelligently.
2สร้าง Conversation Memory — Add Conversation Memory
เก็บประวัติการสนทนาของแต่ละผู้ใช้ เพื่อให้ AI จำบริบทได้ ใช้ object เก็บ userId เป็น key
English: Store conversation history for each user so AI remembers context. Use an object with userId as the key.
3ตอบด้วย Flex Message — Reply with Flex Messages
เมื่อผู้ใช้ถามเกี่ยวกับสินค้าหรือเมนู ให้บอทตอบด้วย Flex Message ที่สวยงามแทนข้อความธรรมดา
English: When users ask about products or menus, reply with beautiful Flex Messages instead of plain text.
4ทดสอบบอทของคุณ — Test Your Bot
ทดสอบบอทโดยถามคำถามต่างๆ ตรวจสอบว่า conversation memory ทำงานถูกต้อง และ Flex Messages แสดงผลสวยงาม
English: Test your bot by asking various questions. Check that conversation memory works correctly and Flex Messages display beautifully.
User: "What food do you recommend?"
Bot: (AI response with restaurant recommendations)
User: "Show me the menu"
Bot: (Flex Message carousel with menu items)
User: "I'll take the one you recommended earlier"
Bot: (AI remembers previous recommendation!) ✅
⚠️ Important Notes / ข้อควรระวัง
- API Keys: Never share your API keys publicly — อย่าเผยแพร่ API keys
- Rate Limits: AI APIs have usage limits — AI API มีข้อจำกัดการใช้งาน
- Error Handling: Always add try/catch blocks — เพิ่ม error handling เสมอ
- Cost: AI API calls cost money — consider caching responses — API AI มีค่าใช้จ่าย
📝 Grammar Checkpoint — ตรวจสอบไวยากรณ์: Gerunds & Infinitives
ก่อนจะจบ ทบทวน Gerunds & Infinitives อีกครั้ง:
Verbs + Gerund (-ing) / กริยา + Gerund:
✅ enjoy + -ing: I enjoy building LINE bots.
✅ finish + -ing: She finished designing the Rich Menu.
✅ keep + -ing: Keep practicing your coding skills.
✅ avoid + -ing: Avoid sharing your API key publicly.
✅ consider + -ing: Consider adding image recognition.
✅ practice + -ing: I practice writing JSON every day.
Verbs + Infinitive (to + V) / กริยา + Infinitive:
✅ want + to V: I want to create an AI customer service bot.
✅ need + to V: You need to install the LINE SDK first.
✅ plan + to V: We plan to add a carousel to the menu.
✅ decide + to V: He decided to use Claude for AI responses.
✅ learn + to V: I learned to build Flex Messages this week.
✅ hope + to V: I hope to finish the project soon.
Preposition + Gerund / บุพบท + Gerund:
✅ I am interested in building AI-powered bots.
✅ She is good at designing user interfaces.
✅ We are excited about launching our new bot.
✅ He is tired of fixing JSON syntax errors.
Common Mistakes / ข้อผิดพลาดที่พบบ่อย:
❌ I enjoy to build bots. → ✅ I enjoy building bots.
❌ She wants creating a menu. → ✅ She wants to create a menu.
❌ He is interested in to learn AI. → ✅ He is interested in learning AI.
⭐ Best Practices — เทคนิคที่ดีที่สุด
💡 Tips for Advanced LINE Bots — เคล็ดลับสำหรับบอท LINE ขั้นสูง
- Start simple: Begin with basic Flex Messages before adding AI — เริ่มจากง่ายก่อนเพิ่ม AI
- Test thoroughly: Test every feature on your phone — ทดสอบทุกฟีเจอร์บนโทรศัพท์
- Handle errors gracefully: If AI fails, have a fallback response — มีข้อความสำรองถ้า AI ล้ม
- Set clear system prompts: Tell AI exactly what role to play — กำหนด system prompt ให้ชัดเจน
- Limit conversation history: Keep only recent messages to save costs — เก็บแค่ข้อความล่าสุด
- Monitor analytics: Check your bot's performance regularly — ตรวจสอบสถิติบอทสม่ำเสมอ
⚠️ Things to Watch Out For — สิ่งที่ต้องระวัง
- JSON syntax: One wrong comma can break your Flex Message — comma ผิดที่เดียวพัง
- Image sizes: Rich Menu images must be exact sizes — รูป Rich Menu ต้องขนาดที่กำหนด
- API costs: AI API calls cost money — manage your budget — API AI มีค่าใช้จ่าย
- User privacy: Don't store sensitive user data — อย่าเก็บข้อมูลส่วนตัวของผู้ใช้
🏆 เก่งมาก! You've Done Great!
คุณได้ฝึกสร้างฟีเจอร์ขั้นสูงของ LINE Bot แล้ว!
You have practiced building advanced LINE Bot features!
You enjoy designing Flex Messages and want to create AI-powered bots!
ตอนนี้คุณพร้อมทำแบบทดสอบแล้ว!
Now you are ready for the exam!