Back-End ์ž‘์—…์‹ค/Spring Framework

[Spring Boot] Discord Bot(๋””์Šค์ฝ”๋“œ ๋ด‡) ๋งŒ๋“ค๊ธฐ

์ฃผ๋‹ˆ์“ฐ๐Ÿง‘‍๐Ÿ’ป 2023. 3. 17. 21:54
728x90
๋ฐ˜์‘ํ˜•

 

 

 

 

 

์ „์ž์ •๋ถ€ ํ‘œ์ค€ ํ”„๋ ˆ์ž„์›Œํฌ์˜ ์–‘๋Œ€ ํ•ต์‹ฌ ๊ธฐ์ˆ  ์„ธํŠธ : ์Šคํ”„๋ง + ๋งˆ์ด๋ฐ”ํ‹ฐ์Šค

COUPANG

www.coupang.com

"์ด ํฌ์ŠคํŒ…์€ ์ฟ ํŒก ํŒŒํŠธ๋„ˆ์Šค ํ™œ๋™์˜ ์ผํ™˜์œผ๋กœ, ์ด์— ๋”ฐ๋ฅธ ์ผ์ •์•ก์˜ ์ˆ˜์ˆ˜๋ฃŒ๋ฅผ ์ œ๊ณต๋ฐ›์Šต๋‹ˆ๋‹ค."

 

 

 

 




๐Ÿ—‚ ๋ชฉ์ฐจ

1. [Spring Boot] Discord Bot(๋””์Šค์ฝ”๋“œ ๋ด‡) ๋งŒ๋“ค๊ธฐ
2. [Spring Boot] Discord Bot(๋””์Šค์ฝ”๋“œ ๋ด‡) ๋งŒ๋“ค๊ธฐ - Spring Boot(์Šคํ”„๋ง ๋ถ€ํŠธ)๋ฅผ ์ด์šฉํ•œ ๊ฐ„๋‹จํ•œ API ๋งŒ๋“ค๊ธฐ feat.Mybatis(๋งˆ์ด๋ฐ”ํ‹ฐ์Šค)

3. [Spring Boot] Discord Bot(๋””์Šค์ฝ”๋“œ ๋ด‡) ๋งŒ๋“ค๊ธฐ - JAVA๋ฅผ ์ด์šฉํ•œ API ํ˜ธ์ถœ

4. [Spring Boot] Discord Bot(๋””์Šค์ฝ”๋“œ ๋ด‡) ๋งŒ๋“ค๊ธฐ - ๋””์Šค์ฝ”๋“œ ๋ด‡์„ ์ด์šฉํ•˜์—ฌ API ํ˜ธ์ถœ

 

 

 

 

 

 

GitHub - junyharang-personal-project/juny-discord-bot-test: JDA๋ฅผ ์ด์šฉํ•œ Spring Boot Discord Bot ์—ฐ์Šต์ด์—์š”.

JDA๋ฅผ ์ด์šฉํ•œ Spring Boot Discord Bot ์—ฐ์Šต์ด์—์š”. Contribute to junyharang-personal-project/juny-discord-bot-test development by creating an account on GitHub.

github.com

 

 

 

 

 

 

๐Ÿš€ ์ดˆ๊ธฐ ๊ตฌ์„ฑ

์ตœ์ดˆ ๋””์Šค์ฝ”๋“œ ๋ด‡์„ ๋“ฑ๋กํ•˜๊ณ , ์ฃผ๋‹ˆ๊ฐ€ ๋งŒ๋“  Server(์„œ๋ฒ„)์— ์ดˆ๋Œ€ํ•˜๋Š” ๋ถ€๋ถ„์„ ํ•ด์ฃผ์–ด์•ผ ํ•ด์š”.

 

Discord Developer Portal — API Docs for Bots and Developers

Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.

discord.com

 

์ตœ์ดˆ ์œ„ Site(์‚ฌ์ดํŠธ)์— ์ ‘์†ํ•ด ์ค๋‹ˆ๋‹ค.


์ตœ์ดˆ ๋กœ๊ทธ์ธ์„ ํ•˜๋ฉด ์ด๋Ÿฐ Page(ํŽ˜์ด์ง€)๋ฅผ ๋งŒ๋‚  ์ˆ˜ ์žˆ์–ด์š”.

์ด ๊ณณ์—์„œ ์œ„ ์˜ค๋ฅธ์ชฝ์— New Application์„ ๋ˆŒ๋Ÿฌ ์ค๋‹ˆ๋‹ค.



์œ„์™€ ๊ฐ™์ด ์ด๋ฆ„์„ ์ •์˜ํ•ด์ฃผ๊ณ , ์ด์šฉ ์•ฝ๊ด€์— ๋™์˜๋ฅผ ํ•ด ์ค€ ๋’ค Create๋ฅผ ๋ˆŒ๋Ÿฌ ์ค๋‹ˆ๋‹ค.



Bot Tab์œผ๋กœ ์ด๋™ํ•˜์—ฌ Add Bot ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ ์ค„๊ฒŒ์š”.



Yes, do it! ์„ ๋ˆŒ๋Ÿฌ ์ค๋‹ˆ๋‹ค. 


MESSAGE CONTENT INTENT๋ฅผ ์œ„์™€ ๊ฐ™์ด ํ—ˆ์šฉ์„ ํ•ด์ฃผ์–ด์•ผ ๋””์Šค์ฝ”๋“œ์—์„œ ๋ฉ”์‹œ์ง€๋ฅผ ์ž…๋ ฅํ–ˆ์„ ๋•Œ, ์Šคํ”„๋ง ๋ถ€ํŠธ์—์„œ ๋ฐ›์„ ์ˆ˜ ์žˆ์–ด์š”.

๋งŒ์•ฝ ์ด๋ ‡๊ฒŒ ํ•˜์ง€ ์•Š๋Š”๋‹ค๋ฉด ์Šคํ”„๋ง ๋ถ€ํŠธ์—์„œ๋Š” ๊ณต๋ฐฑ๊ฐ’๋งŒ ๋“ค์–ด์˜ค๊ฒŒ ๋ ๊ฑฐ์—์š”.

์ด๊ฑฐ ์ฐพ๋Š๋ผ ๋งŽ์ด ๊ณ ์ƒํ–ˆ์–ด์š”...

 

 

 

 


์ด๋ ‡๊ฒŒ ํ•˜๋ฉด Bot์ด ๋งŒ๋“ค์–ด ์ง„๊ฑธ ํ™•์ธ ํ•  ์ˆ˜ ์žˆ์–ด์š”.

๊ทธ๋Ÿฐ ๋’ค TOKEN์— COPY๋ฅผ ๋ˆ„๋ฅด๋ฉด BOT ๊ด€๋ จ TOKEN ๊ฐ’์„ ์–ป์„ ์ˆ˜ ์žˆ์–ด์š”.

์‹ค์ œ JAVA์—์„œ ์ด TOKEN ๊ฐ’์„ ์จ์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์ž˜ ์ €์žฅํ•ด ๋‘์–ด์•ผ ํ•ด์š”.

 


๊ทธ๋Ÿผ ์œ„์™€ ๊ฐ™์ด APPLICATION ID, PUBLIC KEY๊ฐ€ ๋งŒ๋“ค์–ด์ง„ ๊ฑธ ํ™•์ธํ•  ์ˆ˜ ์žˆ์–ด์š”.



OAuth2 Tab์— ๋“ค์–ด๊ฐ€ ๋ณด๋ฉด ์œ„์™€ ๊ฐ™์ด CLIENT ID๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์–ด์š”.


 

OAuth2 -> URL Generator

 


์ด ๊ณณ์—์„œ BOT์— ๊ถŒํ•œ๋„ ์„ค์ •ํ•ด ์ค„ ์ˆ˜ ์žˆ์–ด์š”.

OAuth2 -> URL Generator

 


์ฃผ๋‹ˆ๋Š” ์œ„์™€ ๊ฐ™์ด BOT์—๊ฒŒ ๊ถŒํ•œ์„ ์ฃผ๋ ค๊ณ  ํ•ด์š”.

OAuth2 -> URL Generator

 


๋ฐ‘์— ์œ„์™€ ๊ฐ™์ด URL์ด ํ•˜๋‚˜ ๋งŒ๋“ค์–ด์งˆํ…๋ฐ, ๊ทธ๊ฑธ ๋ธŒ๋ผ์šฐ์ €์— ์ž…๋ ฅ ํ•ด ์ค๋‹ˆ๋‹ค.


 

url :&nbsp;https://discord.com/api/oauth2/authorize?client_id=&nbsp;&permissions=8&scope=bot https://discord.com/api/oauth2/authorize?client_id=<CLIENT ID>&permissions=8&scope=bot



์ ‘์†์„ ํ•˜๋ฉด ์œ„์™€ ๊ฐ™์€ ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•  ์ˆ˜ ์žˆ์–ด์š”.



์œ„์™€ ๊ฐ™์ด ์ถ”๊ฐ€ํ•  ๋””์Šค์ฝ”๋“œ ์„œ๋ฒ„๋ฅผ ์„ ํƒํ•˜๊ณ , ์Šน์ธ์„ ๋ˆŒ๋Ÿฌ ์ค๋‹ˆ๋‹ค.

 


์ฃผ๋‹ˆ๊ฐ€ ๋งŒ๋“  test-bot์ด ์ฑ„๋„์— ๋“ค์–ด์˜จ ๊ฑธ ํ™•์ธํ•  ์ˆ˜ ์žˆ์–ด์š”.


์ด์ œ Bot ์ค€๋น„๋ฅผ ์™„๋ฃŒํ•˜์˜€์œผ๋‹ˆ ์Šคํ”„๋ง ๋ถ€ํŠธ Project(ํ”„๋กœ์ ํŠธ)๋ฅผ ๋งŒ๋“ค์–ด ์ฃผ๋„๋ก ํ• ๊ฒŒ์š”.


์ฃผ๋‹ˆ๋Š” InteliJ Ultimate (์ธํ…”๋ฆฌ์ œ์ด ์–ผํ‹ฐ๋ฉ”์ดํŠธ) Version(๋ฒ„์ „)์„ ํ†ตํ•ด ์œ„์™€ ๊ฐ™์ด ํ”„๋กœ์ ํŠธ๋ฅผ ๋งŒ๋“ค์–ด ์ฃผ๋ ค๊ณ  ํ•ด์š”.


์Šคํ”„๋ง ๋ถ€ํŠธ ๋ฒ„์ „๊ณผ Dependency(์˜์กด์„ฑ)์€ ์ด๋ ‡๊ฒŒ ์„ค์ •์„ ํ•˜๊ณ  ์‹œ์ž‘ํ•ด ๋ณด๋ ค๊ณ  ํ•ด์š”.



 

GitHub - DV8FromTheWorld/JDA: Java wrapper for the popular chat & VOIP service: Discord https://discord.com

Java wrapper for the popular chat & VOIP service: Discord https://discord.com - GitHub - DV8FromTheWorld/JDA: Java wrapper for the popular chat & VOIP service: Discord https://discord.com

github.com


์ฃผ๋‹ˆ๋Š” JDA๋ผ๋Š” ๊ฒƒ์„ ์ด์šฉํ•ด์„œ ๊ฐœ๋ฐœ์„ ์ฆ๊ฒจ๋ณด๋ ค๊ณ  ํ•ด์š”.

 

 

build.gradle

 



 


JDA ์˜์กด์„ฑ์„ build.gradle์— ์ถ”๊ฐ€ํ•ด ์ฃผ์—ˆ์–ด์š”.

repositories {
  mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    compileOnly 'org.projectlombok:lombok'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    runtimeOnly 'com.h2database:h2'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    // Discord Bot ์‚ฌ์šฉ์„ ์œ„ํ•œ JDA ์˜์กด์„ฑ
    implementation 'net.dv8tion:JDA:5.0.0-beta.5'
}
๋ฐ˜์‘ํ˜•
 

์ด์ œ ์ฆ๊ฒ๊ฒŒ ์ฝ”๋”ฉ์„ ์ฆ๊ฒจ ๋ณผ๊ฒŒ์š”.

 

 

    ๐Ÿ”ฝ  ์ฝ”๋“œ ์ž‘์„ฑ ๋ฐ ์ดˆ๊ธฐ ์„ค์ •

application.yml

 


์ตœ์ดˆ ๋””์Šค์ฝ”๋“œ ๋ด‡ Token(ํ† ํฐ) ๊ฐ’์„ ์•ˆ์ „ํ•˜๊ฒŒ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด application.yml์— ์œ„์™€ ๊ฐ™์ด ๊ฐ’์„ ๋„ฃ์–ด ์ฃผ์—ˆ์–ด์š”.

com/junyss/discordbottest/DiscordBotTestApplication.java 1 ~ 30๋ฒˆ์งธ ์ค„

 


์ตœ์ดˆ ์œ„์™€ ๊ฐ™์ด main()์ด ์žˆ๋Š” ๊ณณ์— Login์ด ์•ˆ ๋˜์—ˆ์„ ๋•Œ ์ฒ˜๋ฆฌ๋ฅผ ์œ„ํ•œ LoginException์„ ์ฒ˜๋ฆฌํ•˜๋„๋ก ํ•ด ์ฃผ์—ˆ์–ด์š”.

20~22๋ฒˆ์งธ ์ค„ ์ฝ”๋“œ๋Š” application.yml์— ์ž…๋ ฅํ•œ Token๊ฐ’์„ main()์—์„œ ๊ฐ€์ ธ์˜ค๊ฒŒ ํ•˜๊ธฐ ์œ„ํ•ด ๋งŒ๋“  ๋ถ€๋ถ„์ด์—์š”.

24๋ฒˆ์งธ ์ค„์— JDABuilder๋ฅผ ํ†ตํ•ด application.yml์— ์ž…๋ ฅ๋œ Token๊ฐ’์„ ๊ฐ€์ ธ์˜ค๊ฒŒ ํ•ด์ค๋‹ˆ๋‹ค.

25๋ฒˆ์งธ ์ค„์— ๋ฌธ์ž์—ด์„ ๋„ฃ๊ฒŒ ๋˜๋ฉด 


์œ„์™€ ๊ฐ™์ด ์ƒํƒœ ๋ฉ”์„ธ์ง€๋ฅผ ์ฒ˜๋ฆฌํ•ด ์ค„ ์ˆ˜ ์žˆ์–ด์š”.

26๋ฒˆ์งธ ์ค„์— GatewayIntent๋ฅผ ํ†ตํ•ด Message๋ฅผ ๋””์Šค์ฝ”๋“œ์—์„œ ๋ฐ›์„ ์ˆ˜ ์žˆ๋„๋ก ์ฒ˜๋ฆฌํ•ด ์ค˜์•ผ ํ•ด์š”.

๊ทธ๋Ÿฐ ๋’ค 27๋ฒˆ์งธ ์ค„์— EventListener์—์„œ Listener ๊ฐ์ฒด๋ฅผ ๋งŒ๋“ค์–ด Message๋ฅผ ์ฃผ๊ณ  ๋ฐ›์„ ์ˆ˜ ์žˆ๊ฒŒ ์ฒ˜๋ฆฌํ•ด ์ค„ ์ˆ˜ ์žˆ์–ด์š”.


com/junyss/discordbottest/DiscordBotTestApplication.java 32 ~ 40๋ฒˆ์งธ ์ค„

 

์œ„ ๋ถ€๋ถ„์—์„œ application.yml์— ์žˆ๋Š” Token ๊ฐ’์„ ๊ฐ€์ ธ์™€์„œ Getter๋ฅผ ํ†ตํ•ด main()์—์„œ Token๊ฐ’์„ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ๋„๋ก ์ฒ˜๋ฆฌํ•ด ์ฃผ์—ˆ์–ด์š”.


 

 

com/junyss/discordbottest/listener/JunyssDiscordListener.java 1 ~ 28๋ฒˆ์งธ ์ค„

 

 

728x90

 

 

์ด๋ฒˆ์—๋Š” ์‹ค์ œ๋กœ ๋ฉ”์‹œ์ง€ ์ฒ˜๋ฆฌ๋ฅผ ๋‹ด๋‹นํ•  DiscordListener๋ฅผ ๋งŒ๋“ค์–ด ์ฃผ์—ˆ์–ด์š”.

18๋ฒˆ์งธ ์ค„์— ๋งค๊ฐœ ๋ณ€์ˆ˜ event ์•ˆ์— ๋””์Šค์ฝ”๋“œ์—์„œ ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋‚ธ ์‚ฌ๋žŒ์˜ ์ •๋ณด๋ฅผ ๊ฐ€์ ธ์˜ค๋„๋ก ํ•˜์—ฌ ์ฃผ๊ณ ,

19๋ฒˆ์งธ ์ค„์— ๋ด‡์ด ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋‚ผ ๋””์Šค์ฝ”๋“œ Channel(์ฑ„๋„) ์ •๋ณด๋ฅผ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ๋„๋ก ํ•˜์—ฌ ์ฃผ์—ˆ์–ด์š”.

๊ทธ๋Ÿฐ ๋’ค 20๋ฒˆ์งธ ์ค„์— ๋””์Šค์ฝ”๋“œ ์ชฝ์—์„œ ์ „๋‹ฌ๋œ ๋ฉ”์‹œ์ง€๋ฅผ ๋ฐ›์„ ์ˆ˜ ์žˆ๋Š” ๋ณ€์ˆ˜๋“ค์„ ๋งŒ๋“ค์–ด ์ฃผ์—ˆ์–ด์š”.

24๋ฒˆ์งธ ์ค„์— ๋ฉ”์‹œ์ง€ ๋ณด๋‚ธ ์‚ฌ๋žŒ์˜ ์ •๋ณด๊ฐ€ ๋ด‡์ด๋ผ๋ฉด ์•„๋ฌด  ๋™์ž‘์„ ํ•˜์ง€ ์•Š๋„๋ก ์ฒ˜๋ฆฌํ•˜์—ฌ ์ฃผ์—ˆ๊ณ , ๋ฉ”์‹œ์ง€๋กœ ๋“ค์–ด์˜จ ๋‚ด์šฉ์ด ๊ณต๋ฐฑ์ด๋ผ๋ฉด 27๋ฒˆ์งธ ์ค„ ๋™์ž‘์ด ์ฒ˜๋ฆฌ๋  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด ์ฃผ์—ˆ์–ด์š”.



com/junyss/discordbottest/listener/JunyssDiscordListener.java 1 ~ 28๋ฒˆ์งธ ์ค„

 


์ฃผ๋‹ˆ๋Š” ๋””์Šค์ฝ”๋“œ์—์„œ ๋“ค์–ด์˜จ ๋ฉ”์‹œ์ง€๋ฅผ ๋„์–ด์“ฐ๊ธฐ ์ฆ‰, ๊ณต๋ฐฑ์„ ๊ธฐ์ค€์œผ๋กœ ์ž˜๋ผ์„œ ์ฒ˜๋ฆฌ๋ฅผ ํ•˜๊ณ  ์‹ถ์—ˆ๊ธฐ ๋•Œ๋ฌธ์— 30๋ฒˆ์งธ ์ค„ ์ฒ˜๋Ÿผ ๊ณต๋ฐฑ์„ ๊ธฐ์ค€์œผ๋กœ messageArray์— ๊ฐ๊ฐ์˜ ๋ฌธ์ž์—ด์ด ๋“ค์–ด๊ฐˆ ์ˆ˜ ์žˆ๋„๋ก ํ•˜์—ฌ ์ฃผ์—ˆ์–ด์š”.

๊ทธ๋Ÿฐ ๋’ค 32๋ฒˆ์งธ ์ค„์— ๋ฉ”์‹œ์ง€์˜ ์ฒซ๋ฒˆ์งธ ๋ฌธ์ž์—ด์ด ์ฃผ๋‹ˆ์•ผ๋ผ๋ฉด 34 ~ 38๋ฒˆ์งธ ์ค„ ์ฒ˜๋ฆฌ๊ฐ€ ๋˜๋„๋ก ํ•˜์—ฌ์ฃผ์—ˆ์–ด์š”.

์ฐธ๊ณ ๋กœ equalsIgnoreCase()๋Š” ๋Œ€, ์†Œ๋ฌธ์ž๋ฅผ ๊ตฌ๋ถ„ํ•˜์ง€ ์•Š๊ณ , ๋“ค์–ด์˜จ ๊ฐ’์„ ์‹๋ณ„ํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉํ•˜๋Š” Method(๋ฉ”์„œ๋“œ)์—์š”.

34๋ฒˆ์งธ ์ค„์„ ๋ณด๋ฉด messageArray์— ๊ฐ’ ์ค‘ ๋งจ ์ฒซ ๋ฐฐ์—ด๊ฐ’์ธ ์ฃผ๋‹ˆ์•ผ๋Š” ์ด์ œ ํ•„์š”๊ฐ€ ์—†๊ธฐ ๋•Œ๋ฌธ์— ํ•ด๋‹น ๊ฐ’์„ ์ œ์™ธํ•œ ๋‚˜๋จธ์ง€ ๋ฌธ์ž์—ด๋“ค์„ ์ƒˆ๋กญ๊ฒŒ messageArgs ๋ฐฐ์—ด์— ๋„ฃ์–ด ์ฃผ์—ˆ์–ด์š”.

36๋ฒˆ์งธ์— ํ•ด๋‹น ๋ฌธ์ž์—ด ๋ฐฐ์—ด ๊ฐœ์ˆ˜๋งŒํผ ๋ฐ˜๋ณตํ•˜๊ฒŒ ํ•˜์—ฌ sendMessage()์—์„œ event์™€ ๋ฉ”์‹œ์ง€ ๋‚ด์šฉ์„ ๋ฐ›์•„ ๋ด‡์ด ๋ฐ˜ํ™˜ํ•  ๋ฉ”์‹œ์ง€๋ฅผ ๋งŒ๋“ค์–ด ๋ฐ˜ํ™˜๋ฐ›์„ ์ˆ˜ ์žˆ๋„๋ก ํ•ด ์ฃผ์—ˆ์–ด์š”.

๊ทธ๋Ÿฐ ๋’ค 38๋ฒˆ์งธ ์ค„์— ๋ฐ˜ํ™˜ ๋ฐ›์€ ๋ด‡์— ๋Œ€๋‹ต์„ ๋””์Šค์ฝ”๋“œ ํ•ด๋‹น ์ฑ„๋„๋กœ ๋ณด๋‚ด์งˆ ์ˆ˜ ์žˆ๊ฒŒ ํ•ด ์ฃผ์—ˆ์–ด์š”.


com/junyss/discordbottest/listener/JunyssDiscordListener.java 43 ~ 60๋ฒˆ์งธ ์ค„

 

์ด ๊ณณ์—์„œ ๋””์Šค์ฝ”๋“œ ๋ด‡์ด ๋Œ€๋‹ตํ•  ๋ฌธ์ž์—ด์„ ๋งŒ๋“ค์–ด ์ค„ ์ˆ˜ ์žˆ๊ฒŒ ํ•ด ์ฃผ์—ˆ์–ด์š”.

45๋ฒˆ์งธ ์ค„์— event.getAuthor()๋ฅผ ํ†ตํ•ด ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋‚ธ ์‚ฌ์šฉ์ž์˜ ์ •๋ณด๋ฅผ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ๋Š” ๊ฐ์ฒด๋ฅผ user ๋ณ€์ˆ˜์— ๋„ฃ์–ด ์ฃผ์—ˆ๊ณ , ๋ด‡์ด ๋ฐ˜ํ™˜ํ•  ๋Œ€๋‹ต ๋ฌธ์ž์—ด ๋ณ€์ˆ˜ returnMessage๋ฅผ ๊ณต๋ฐฑ์œผ๋กœ ์ดˆ๊ธฐํ™” ํ•ด ์ฃผ์—ˆ์–ด์š”.

๊ทธ๋Ÿฐ ๋’ค ๋งค๊ฐœ ๋ณ€์ˆ˜๋กœ ์ „๋‹ฌ๋œ message ์ฆ‰, ์‚ฌ์šฉ์ž๊ฐ€ ๋ณด๋‚ธ ๋ฉ”์‹œ์ง€๋ฅผ ๊ฐ€์ง€๊ณ , ๋ถ„๊ธฐ๋ฌธ(switch)๊ฐ€ ์ฒ˜๋ฆฌ ๋˜๋„๋ก ํ•˜์˜€๋Š”๋ฐ, ์•ˆ๋…• ์ด๋ผ๋Š” ๋ฌธ์ž์—ด์ด ๋“ค์–ด์˜จ๋‹ค๋ฉด ๋Œ€๋‹ต ๋ฌธ์ž์—ด ๋ณ€์ˆ˜์— ๋ณด๋‚ธ ์‚ฌ์šฉ์ž๊ฐ€ ์„ค์ •ํ•œ ๋””์Šค์ฝ”๋“œ ์ด๋ฆ„๊ฐ’๊ณผ ํ•จ๊ป˜ ๋ฐ˜ํ™˜๋  ๋ฌธ์ž์—ด์„ ๋„ฃ์–ด์ฃผ์—ˆ์–ด์š”.


51๋ฒˆ์งธ case์— ์‚ฌ์šฉ์ž๊ฐ€ test๋ผ๋Š” ๋ฌธ์ž์—ด์„ ๋ณด๋ƒˆ๋‹ค๋ฉด ์‚ฌ์šฉ์ž ๊ณ„์ •์˜ Tag ์ •๋ณด๊ฐ’๊ณผ ํ•จ๊ป˜ ๋ฌธ์ž์—ด์ด ๋Œ€๋‹ต ๋ฌธ์ž์—ด ๋ณ€์ˆ˜์— ๋“ค์–ด๊ฐˆ ์ˆ˜ ์žˆ๋„๋ก ํ•˜์—ฌ ์ฃผ์—ˆ์–ด์š”.

 

๋งˆ์ง€๋ง‰์œผ๋กœ ๋ˆ„๊ตฌ์•ผ๋ผ๋Š” ๋ฌธ์ž์—ด์ด ๋“ค์–ด์˜จ๋‹ค๋ฉด ์‚ฌ์šฉ์ž๋ฅผ Mention(๋ฉ˜์…˜)ํ•˜์—ฌ ๋ถ€๋ฅธ ๋’ค ๋’ค์— ๋ฌธ์ž์—ด์ด ๋“ค์–ด๊ฐˆ ์ˆ˜ ์žˆ๋„๋ก ์ฒ˜๋ฆฌํ•ด ์ฃผ์—ˆ์–ด์š”.


์ด๋ ‡๊ฒŒ ๋””์Šค์ฝ”๋“œ๋ฅผ ํ†ตํ•ด ๋ด‡๊ณผ ๋Œ€ํ™”ํ•  ์ˆ˜ ์žˆ๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ๋งŒ๋“ค์–ด ๋ณด์•˜์–ด์š”.

๋‹ค์Œ์—๋Š” Data Base(๋ฐ์ดํ„ฐ ๋ฒ ์ด์Šค)์— ์ €์žฅ๋œ ๊ฐ’์„ ์กฐํšŒํ•  ์ˆ˜ ์žˆ๋Š” ๊ธฐ๋Šฅ์„ ๋งŒ๋“ค์–ด ๋ณด๋„๋ก ํ• ๊ฒŒ์š”.

 

์†Œ์Šค์ฝ”๋“œ๋Š” ์ด ๊ณณ์— ์ค€๋น„ํ•ด ๋‘์—ˆ์–ด์š”.

 

 

 

 

์ „์ž์ •๋ถ€ ํ‘œ์ค€ ํ”„๋ ˆ์ž„์›Œํฌ์˜ ์–‘๋Œ€ ํ•ต์‹ฌ ๊ธฐ์ˆ  ์„ธํŠธ : ์Šคํ”„๋ง + ๋งˆ์ด๋ฐ”ํ‹ฐ์Šค

COUPANG

www.coupang.com

"์ด ํฌ์ŠคํŒ…์€ ์ฟ ํŒก ํŒŒํŠธ๋„ˆ์Šค ํ™œ๋™์˜ ์ผํ™˜์œผ๋กœ, ์ด์— ๋”ฐ๋ฅธ ์ผ์ •์•ก์˜ ์ˆ˜์ˆ˜๋ฃŒ๋ฅผ ์ œ๊ณต๋ฐ›์Šต๋‹ˆ๋‹ค."

 







๐Ÿง ์ฐธ๊ณ  ์ž๋ฃŒ

 

GitHub - DV8FromTheWorld/JDA: Java wrapper for the popular chat & VOIP service: Discord https://discord.com

Java wrapper for the popular chat & VOIP service: Discord https://discord.com - GitHub - DV8FromTheWorld/JDA: Java wrapper for the popular chat & VOIP service: Discord https://discord.com

github.com

 

 

 

 

 

 

 

728x90
๋ฐ˜์‘ํ˜•