mirror of
https://code.dnix.de/da/flokatirc
synced 2026-07-27 08:39:45 +02:00
Added module configuration params: -params=<key>:<val>(!<key>:<val>])*
This commit is contained in:
+5
-5
@@ -136,7 +136,7 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
msgHandlers["twitch"] = twitchHandleMessage
|
||||
MsgHandlers["twitch"] = twitchHandleMessage
|
||||
log.Println("Initializing twitch module")
|
||||
go pollStreamData()
|
||||
}
|
||||
@@ -165,7 +165,7 @@ func twitchHandleMessage(m *irc.Message) {
|
||||
}
|
||||
}
|
||||
if onlinestreams == 0 {
|
||||
sayCh <- fmt.Sprintf("*\n%s", "[TWTCH] All streams offline")
|
||||
SayCh <- fmt.Sprintf("*\n%s", "[TWTCH] All streams offline")
|
||||
}
|
||||
case 2:
|
||||
streamname := tok[1]
|
||||
@@ -176,7 +176,7 @@ func twitchHandleMessage(m *irc.Message) {
|
||||
co = getTwitchChannelObject(streamname)
|
||||
twitchSendMsg(co, so)
|
||||
} else {
|
||||
sayCh <- fmt.Sprintf("*\n%s", "[TWTCH] "+streamname+" not found or offline")
|
||||
SayCh <- fmt.Sprintf("*\n%s", "[TWTCH] "+streamname+" not found or offline")
|
||||
}
|
||||
default:
|
||||
}
|
||||
@@ -242,6 +242,6 @@ func getTwitchChannelObject(streamname string) TwitchChannelObject {
|
||||
}
|
||||
|
||||
func twitchSendMsg(tcobj TwitchChannelObject, tso TwitchStreamObject) {
|
||||
sayCh <- fmt.Sprintf("*\n%s", "[TWTCH] "+tso.Stream.Channel.DisplayName+", "+util.NumberToString(tso.Stream.Viewers, '.')+" viewers, playing: "+tso.Stream.Game+", "+tcobj.URL)
|
||||
sayCh <- fmt.Sprintf("*\n%s", "[TWTCH] "+"Title: \""+tcobj.Status+"\"")
|
||||
SayCh <- fmt.Sprintf("*\n%s", "[TWTCH] "+tso.Stream.Channel.DisplayName+", "+util.NumberToString(tso.Stream.Viewers, '.')+" viewers, playing: "+tso.Stream.Game+", "+tcobj.URL)
|
||||
SayCh <- fmt.Sprintf("*\n%s", "[TWTCH] "+"Title: \""+tcobj.Status+"\"")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user