# Discord Bot & Example

เมื่อก่อนใช้ ! ตามด้วยชื่อ command ในการสั่งงาน bot แต่หลาย ๆ bot ก็มีคำสั่งที่เหมือนกัน เช่น !ping ทำให้เราเรียกคำสั่งนี้คำสั่งเดียว บอทหลาย ๆ ตัวทำงาน

จนทาง Discord มาปรับให้เรียกจาก Slash Command แทน และให้ตัว bot เป็นเหมือน application นึงใน server น้ัน ๆ

<figure><img src="/files/tiFECQNnbVqsSRgB3k8C" alt=""><figcaption></figcaption></figure>

### Example

* Pandaz Guard Beta: เป็น bot ที่รักษาความปลอดภัยใน server สำหรับคนใหม่ที่เข้ามา จะต้องอ่านกฏ ปิด DM และกรอก capcha เพื่อยืนยันตัวตน จึงจะได้เข้า

<figure><img src="https://lh7-rt.googleusercontent.com/slidesz/AGV_vUdJooAs-pZ9XGZwvMjyoGALfUjq4DVdzmU3DBemViIhk_Giu0cLfqSvJqCdOfWka5AShAbI5OUWG2IzXGpvHqGgRWe_J8UnBxdO-2w8_aqgzByPeHe9J3hFRCa3BfH01kB2YhMFiQ=s2048?key=zouhIV8Fq_fCPxgqccmT5w" alt=""><figcaption></figcaption></figure>

* The Engage: engage กับ post เพื่อเก็บแต้ม และเอาไปแลกของต่าง ๆ ใน server ได้โดยการ raffle

<figure><img src="/files/oqWc0508PgBRSm6tIbrs" alt=""><figcaption></figcaption></figure>

* ตัวอย่างกดปุ่มเพื่อกรอกฟอร์ม

<figure><img src="/files/LC8BUNWp2KRe9vi6lIN4" alt=""><figcaption></figcaption></figure>


---

# 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://mikkicoding.mikkipastel.com/discord-bot-hands-on/discord-bot-and-example.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.
