-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
26 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
src/main/kotlin/com/open3r/openmusic/global/config/discord/DiscordListener.kt
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
src/main/kotlin/com/open3r/openmusic/global/config/discord/StartListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.open3r.openmusic.global.config.discord | ||
|
||
import net.dv8tion.jda.api.EmbedBuilder | ||
import net.dv8tion.jda.api.JDA | ||
import org.springframework.boot.context.event.ApplicationStartedEvent | ||
import org.springframework.context.ApplicationListener | ||
import org.springframework.stereotype.Component | ||
|
||
@Component | ||
class StartListener( | ||
private val jda: JDA, | ||
private val discordProperties: DiscordProperties | ||
): ApplicationListener<ApplicationStartedEvent> { | ||
override fun onApplicationEvent(event: ApplicationStartedEvent) { | ||
jda.getTextChannelById(discordProperties.channelId)?.sendMessageEmbeds( | ||
EmbedBuilder() | ||
.setTitle("서버가 시작되었습니다.") | ||
.setColor(0x00FF00) | ||
.build() | ||
)?.queue() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters