# Bring Discord Bot to Server

ไปที่ *OAuth2 -> OAuth2 URL Generator* เลือก **SCOPES** เป็น `bot` นะ

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

เลื่อนลงมาส่วน Bot Permissions ในส่วน Text Permissions ให้ติ๊ก 3 อย่างนี้

* Send Messages
* Read Message History
* Use Slash Commands

จากนั้นเลื่อนไปที่ Generated Url แล้ว copy url นี้ไปเปิดที่หน้า browser

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

พอเปิดลิ้งนี้จะมีหน้าต่างขึ้นแบบนี้เลย เลือก server ที่เราต้องการเพิ่ม bot จากนั้นกด Continue แล้วเราจะเห็น permission ที่ bot ขอใน server ซึ่งตรงกับที่เราติ๊กเมื่อกี้เนอะ เมื่อเรียบร้อยแล้วจะขึ้น success

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

กลับไปที่ server จะเห็น bot ที่เราสร้างไว้เข้ามาใน server แล้ว

<figure><img src="https://lh7-rt.googleusercontent.com/slidesz/AGV_vUeNYYutT1N7A0OReZ0wsuyt1tSEHmSOHkKKXhXgGmAYpCBikc3E3jXHKjqUutvjxqBj4ekoiO84y3WVtUD1yt9tLsKOOA5bBB47BgDCf-ff9NTJ1PDhQAUgn33EdBup6Mn8_pN3cw=s2048?key=zouhIV8Fq_fCPxgqccmT5w" 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/create-your-first-discord-bot/bring-discord-bot-to-server.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.
