mirror of
https://github.com/HMCore/Orbot.git
synced 2026-01-03 08:12:51 +00:00
Add service announcement channel
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package de.wulkanat.web
|
||||
|
||||
import de.wulkanat.Admin
|
||||
import de.wulkanat.DiscordRpc
|
||||
import de.wulkanat.model.BlogPostPreview
|
||||
import org.jsoup.Jsoup
|
||||
import java.io.IOException
|
||||
@@ -8,6 +9,7 @@ import java.io.IOException
|
||||
object SiteWatcher {
|
||||
private const val BLOG_INDEX_URL = "https://www.hytale.com/news"
|
||||
var newestBlog: BlogPostPreview? = null
|
||||
private var siteOnline = false
|
||||
|
||||
fun hasNewBlogPost(): Boolean {
|
||||
try {
|
||||
@@ -26,10 +28,17 @@ object SiteWatcher {
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
Admin.error("Connection to Hytale Server failed", e.message ?: e.localizedMessage)
|
||||
siteOnline = false
|
||||
DiscordRpc.updatePresence(siteOnline)
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
if (siteOnline) {
|
||||
siteOnline = true
|
||||
DiscordRpc.updatePresence(siteOnline)
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user