<commit_before>package me.mrkirby153.KirBot.command.executors.search

import me.mrkirby153.KirBot.command.Command
import me.mrkirby153.KirBot.command.executors.CommandExecutor
import me.mrkirby153.KirBot.utils.Context
import me.mrkirby153.KirBot.utils.embed.b
import me.mrkirby153.KirBot.utils.embed.link
import org.jsoup.Jsoup
import java.awt.Color
import java.io.IOException
import java.net.URLEncoder
import java.nio.charset.StandardCharsets

@Command(name = "google", aliases = arrayOf("g"), description = " Google search!", category = "Fun")
class CommandGoogle : CommandExecutor() {

    override fun execute(context: Context, args: Array<String>) {
        if (args.isEmpty()) {
            context.send().error("Please specify something to google!")
            return
        }
        try {
            context.channel.sendTyping().queue {
                val query = args.joinToString(" ")
                val blocks = Jsoup.connect("https://www.google.com/search?q=${URLEncoder.encode(query, StandardCharsets.UTF_8.displayName())}")
                        .userAgent("KirBot")
                        .get()
                        .select(".g")

                if (blocks.isEmpty()) {
                    context.send().error("No search results for `$query`").queue()
                    return@queue
                }

                context.send().embed {
                    setColor(Color.GREEN)<commit_msg>Disable google command<commit_after>package me.mrkirby153.KirBot.command.executors.search

import me.mrkirby153.KirBot.command.Command
import me.mrkirby153.KirBot.command.executors.CommandExecutor
import me.mrkirby153.KirBot.utils.Context
import me.mrkirby153.KirBot.utils.embed.b
import me.mrkirby153.KirBot.utils.embed.link
import org.jsoup.Jsoup
import java.awt.Color
import java.io.IOException
import java.net.URLEncoder
import java.nio.charset.StandardCharsets

@Command(name = "google", aliases = arrayOf("g"), description = " Google search!", category = "Fun")
class CommandGoogle : CommandExecutor() {

    @Suppress("UNREACHABLE_CODE")
    override fun execute(context: Context, args: Array<String>) {
        context.send().error("Google search has been temporarily disabled!").queue()
        return
        if (args.isEmpty()) {
            context.send().error("Please specify something to google!").queue()
            return
        }
        try {
            context.channel.sendTyping().queue {
                val query = args.joinToString(" ")
                val blocks = Jsoup.connect("https://www.google.com/search?q=${URLEncoder.encode(query, StandardCharsets.UTF_8.displayName())}")
                        .userAgent("KirBot")
                        .get()
                        .select(".g")

                if (blocks.isEmpty()) {
                    context.send().error("No search results for `$query`").queue()
                    return@queue
                }

                context.send().embed {
                    setColor(Color.GREEN)
{'fraction_non_alphanumeric': 0.12179700499168053, 'fraction_numerical': 0.01264559068219634, 'mean_word_length': 2.3289036544850497, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3143630', 'n_tokens_mistral': 876, 'n_tokens_neox': 835, 'n_words': 149}