Skip to content

Commit

Permalink
Update BotServiceImpl.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
Hummel009 committed Nov 16, 2024
1 parent bdbf9ae commit e632a26
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -91,11 +91,11 @@ class BotServiceImpl : BotService {
val channelHistory = channelsHistories.getOrDefault(channelId, null)

if ((event.messageHasBotMention() || Random.nextInt(100) < serverData.chanceAI) && channelHistory != null) {
val prompt = channelHistory.joinToString(
prefix = firstChatPrompt, separator = "\r\n"
)
val reply = HttpClients.createDefault().use { client ->
try {
val prompt = channelHistory.joinToString(
prefix = firstChatPrompt, separator = "\r\n"
)
val url = URIBuilder("https://duck.gpt-api.workers.dev/chat/").apply {
addParameter("prompt", prompt)
}.build().toString()

0 comments on commit e632a26

Please sign in to comment.