-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
16 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ class CurseForge : Extension() { | |
json(Json { ignoreUnknownKeys = true }) | ||
} | ||
install(UserAgent) { | ||
agent = "hyacinthbots/allium/$BUILD ([email protected])" | ||
agent = "hyacinthbots/allium/$BUILD ([email protected])" | ||
} | ||
} | ||
|
||
|
@@ -61,6 +61,7 @@ class CurseForge : Extension() { | |
embedProject(response.data[i]) | ||
} | ||
} | ||
owner = user | ||
timeoutSeconds = 180 | ||
locale = Locale.ENGLISH | ||
}.send() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ import dev.kord.rest.builder.message.EmbedBuilder | |
import dev.kord.rest.builder.message.actionRow | ||
import dev.kord.rest.builder.message.embed | ||
import io.ktor.client.* | ||
import io.ktor.client.plugins.* | ||
import io.ktor.client.request.* | ||
import io.ktor.client.request.forms.* | ||
import io.ktor.client.statement.* | ||
|
@@ -37,6 +38,7 @@ import kotlinx.serialization.Serializable | |
import kotlinx.serialization.json.Json | ||
import org.hyacinthbots.allium.database.collections.ConfigCollection | ||
import org.hyacinthbots.allium.database.collections.LogUploadingCollection | ||
import org.hyacinthbots.allium.utils.BUILD | ||
import java.io.ByteArrayInputStream | ||
import java.io.IOException | ||
import java.util.zip.GZIPInputStream | ||
|
@@ -304,7 +306,11 @@ class LogUploading : Extension() { | |
data class LogData(val success: Boolean, val id: String? = null, val error: String? = null) | ||
|
||
private suspend fun postToMCLogs(text: String): String { | ||
val client = HttpClient() | ||
val client = HttpClient() { | ||
install(UserAgent) { | ||
agent = "hyacinthbots/allium/$BUILD ([email protected])" | ||
} | ||
} | ||
val cleanText = text.replace("\r\n", "\n", true).replace("\r", "\n", true) | ||
val response = client.post("https://api.mclo.gs/1/log") { | ||
setBody( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ class Modrinth : Extension() { | |
json(Json { ignoreUnknownKeys = true }) | ||
} | ||
install(UserAgent) { | ||
agent = "hyacinthbots/allium/$BUILD ([email protected])" | ||
agent = "hyacinthbots/allium/$BUILD ([email protected])" | ||
} | ||
} | ||
|
||
|
@@ -106,6 +106,7 @@ class Modrinth : Extension() { | |
embedProject(response.hits[i]) | ||
} | ||
} | ||
owner = user | ||
timeoutSeconds = 180 | ||
locale = Locale.ENGLISH | ||
}.send() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ private val client = HttpClient(CIO) { | |
json(Json { ignoreUnknownKeys = true }) | ||
} | ||
install(UserAgent) { | ||
agent = "hyacinthbots/allium/$BUILD ([email protected])" | ||
agent = "hyacinthbots/allium/$BUILD ([email protected])" | ||
} | ||
} | ||
|
||
|