Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit db58214

Browse files
committed
Rework of discord service.
Added functionality: * Send & Receive embeds * Send & Receive files * Receive reactions Improved: * Less duplicated code * Updated JDA to latest version
1 parent eee239f commit db58214

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

discordtest/src/main/scala/discordTestPlugin.scala

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
import org.codeoverflow.chatoverflow.api.io.dto.chat.discord.DiscordChatMessage
1+
import java.awt.Color
2+
import java.io.File
3+
4+
import org.codeoverflow.chatoverflow.api.io.dto.chat.discord.{DiscordChatMessage, DiscordEmbed, DiscordReaction}
25
import org.codeoverflow.chatoverflow.api.plugin.{PluginImpl, PluginManager}
6+
37
import scala.collection.JavaConverters._
48

59
class discordTestPlugin(manager: PluginManager) extends PluginImpl(manager) {
@@ -17,6 +21,13 @@ class discordTestPlugin(manager: PluginManager) extends PluginImpl(manager) {
1721
discordInputReq.get.registerMessageEditHandler(onMessageEdit)
1822
discordInputReq.get.registerMessageDeleteHandler(onMessageDelete)
1923
discordOutputReq.get.sendChatMessage("Hey I'm working! \uD83C\uDF89")
24+
discordOutputReq.get().sendFile("../config/config.xml")
25+
discordOutputReq.get().sendFile("allowed_file.png")
26+
discordOutputReq.get().sendChatMessage(DiscordEmbed.Builder()
27+
.withColor(Color.RED)
28+
.withDescription("test")
29+
.withAuthor("skateShiny", null, "https://cdn.discordapp.com/emojis/496389587329875981.png?v=1")
30+
.build())
2031
println("Startet succesfully")
2132
}
2233

0 commit comments

Comments
 (0)