> For the complete documentation index, see [llms.txt](https://mikkicoding.mikkipastel.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mikkicoding.mikkipastel.com/discord-bot-hands-on/create-your-first-discord-bot/bring-discord-bot-to-server.md).

# 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>
