otakusenpai
08/30/2018, 2:33 PMmarstran
08/30/2018, 2:38 PMTimer.schedule
is not a coroutine-construct. What kind of "plugin" are you talking about?otakusenpai
08/30/2018, 2:39 PMmarstran
08/30/2018, 2:40 PMotakusenpai
08/30/2018, 2:40 PMmarstran
08/30/2018, 2:41 PMmarstran
08/30/2018, 2:47 PMotakusenpai
08/30/2018, 2:48 PMmarstran
08/30/2018, 2:51 PMotakusenpai
08/30/2018, 2:53 PMelse if(strList.get(1) == "ban") {
var found = false
if(size <= 3) {
retData = "Usage: ${specialChar}chan ban #channel prefix or " +
"${specialChar}chan ban #channel prefix except or " +
"${specialChar}chan ban #channel prefix time or " +
"${specialChar}chan ban #channel prefix except time." +
" Time can be in the following format: 6D or 6d(day), 10M or 10m(minute)." +
" Following are some common literals for time: Second - s/S, Minute - m/M, Hour - h/H, Day - d,D. " +
"Others need not be implemented."
type = 1
} else if(size > 3) {
for(i in channelList) {
if(i.retName() == strList.get(2)) {
if(size == 4) { // 1st
if(isPrefix(strList.get(3))) {
retData = SendBan(strList.get(2),strList.get(3))
type = 2
}
} else if(size == 5) { // 2nd n 3rd
if(isPrefix(strList.get(3))) {
if(isPrefix(strList.get(4))) { // 2nd
retData = SendBanwithExcept(strList.get(2),strList.get(3),strList.get(4))
type = 2
} else if(parseTimeInput(strList.get(4)).third) { // 3rd
val data = parseTimeInput(strList.get(4))
val timeSecs = setTimeInNumbers(data.second)
Timer().schedule(timeSecs) {
retData = SendBan(strList.get(2),strList.get(3))
}
}
}
} else if(size == 6) {
if(isPrefix(strList.get(3)) && isPrefix(strList.get(4)) &&
parseTimeInput(strList.get(5)).third) {
val data = parseTimeInput(strList.get(4))
val timeSecs = setTimeInNumbers(data.second)
Timer().schedule(timeSecs) {
retData = SendBanwithExcept(strList.get(2),strList.get(3),strList.get(4))
}
}
}
}
}
}
}
marstran
08/30/2018, 2:53 PMotakusenpai
08/30/2018, 2:53 PMTimer().schedule(timeSecs) {
retData = SendBan(strList.get(2),strList.get(3))
}
marstran
08/30/2018, 2:58 PMretData
like that.otakusenpai
08/30/2018, 2:59 PMmarstran
08/30/2018, 3:00 PMretData
variable no longer exists.retData
is defined inside your function, like it is in onCommand
.otakusenpai
08/30/2018, 3:01 PMmarstran
08/30/2018, 3:02 PMSendBan
to a variable, I think you should send it as a message on a channel.otakusenpai
08/30/2018, 3:02 PMmarstran
08/30/2018, 3:02 PMretData
should instead subscribe to the channel, and act on the SendBan
message.otakusenpai
08/30/2018, 3:02 PMotakusenpai
08/30/2018, 3:04 PMmarstran
08/30/2018, 3:05 PMTimer.schedule
?otakusenpai
08/30/2018, 3:05 PMmarstran
08/30/2018, 3:06 PMotakusenpai
08/30/2018, 3:06 PMmarstran
08/30/2018, 3:06 PMotakusenpai
08/30/2018, 3:09 PMgildor
08/31/2018, 8:10 AMdelay
from kotlinx.coroutines