Skip to content

Commit

Permalink
Expand lmgtfy command, use site that uses Google
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickster258 committed Jul 30, 2024
1 parent 4efbb95 commit cd4a8a4
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/main/kotlin/org/openredstone/chad/commands/Command.kt
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,18 @@ fun insultCommand(insults: List<String>) = command {
}

val lmgtfy = command {
val search by required()
val search by vararg()
reply {
buildString {
append("https://letmegooglethat.com/?q=")
append(search.split("\\s+").joinToString("+") {
URLEncoder.encode(it, "utf-8")
})
if (search.isEmpty()) {
"No query provided!"
} else {
buildString {
append("<https://letmegoogleforyou.com/?q=")
append(search.joinToString("%20") {
URLEncoder.encode(it, "utf-8")
})
append(">")
}
}
}
}
Expand Down

0 comments on commit cd4a8a4

Please sign in to comment.