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

Commit eee239f

Browse files
committed
Rework inputs & outputs / prettify xml output
1 parent 16ca799 commit eee239f

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

discordtest/build.sbt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// GENERATED FILE USING THE CHAT OVERFLOW PLUGIN FRAMEWORK
2+
3+
name := "discordTest"
4+
version := "0.1"

discordtest/src/main/scala/discordTestPlugin.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ class discordTestPlugin(manager: PluginManager) extends PluginImpl(manager) {
66

77
private val discordInputReq = require.input.discordChat("reqDiscordIn", "Discord input", false)
88
private val discordOutputReq = require.output.discordChat("reqDiscordOut", "Discord output", false)
9+
private val discordChannelReq = require.parameter.string("reqDiscordChannel", "The id of the channel to which the bot should connect", false)
910

1011
override def setup(): Unit = {
12+
discordInputReq.get.setChannel(discordChannelReq.get.get)
13+
discordOutputReq.get.setChannel(discordChannelReq.get.get)
1114
println(s"Input connected to channel ${discordInputReq.get().getChannelId}")
1215
println(s"Output connected to channel ${discordOutputReq.get().getChannelId}")
1316
discordInputReq.get.registerMessageHandler(onMessage)

simpletest/src/main/scala/simpletestPlugin.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ class simpletestPlugin(manager: PluginManager) extends PluginImpl(manager) {
44

55
private val twitchChatInputReq = require.input.twitchChat("reqTwitch", "A twitch channel", false)
66
private val nameToSayHelloToReq = require.parameter.string("reqHello", "Your name", false)
7+
private val twitchChannelReq = require.parameter.string("reqTwitchChannel", "The name of the channel that you want to connect to.", false)
78
loopInterval = 1000
89

910
override def setup(): Unit = {
1011
println("Started successfully!")
1112
log("Hello!")
1213
log("Whats up?")
1314
log("I am new!")
14-
15+
twitchChatInputReq.get.setChannel(twitchChannelReq.get.get)
1516
twitchChatInputReq.get.registerMessageHandler(msg => println(msg))
1617

1718
println(s"Hello ${nameToSayHelloToReq.get.get()}!")

0 commit comments

Comments
 (0)