<commit_before># Plugin mais feio do mundo, mas é só pra um chat específico.
# Aqui temos comandos que são pequenos demais pra terem seu próprio módulo.

# Como esse plugin é ativado por todas as mensagens, o /stats também funcionará por aqui.

# A maioria é um port bem rápido de https://github.com/lucasberti/telegrao/blob/master/plugins/taup.lua

from api import send_message, send_sticker, send_document, send_photo, send_voice
from random import randint, choice, randrange
from datetime import datetime
import json
import re
from PIL import Image
import requests
import os
from io import BytesIO
import plugins.stats as stats
import plugins.ed as ed
import time

emotes = {}
arrobas = {}

stickers_loaded = False
arrobas_loaded = False


def on_msg_received(msg, matches):
    chat = msg["chat"]["id"]
    text = msg["text"]
    now = time.time()

    stats.do_statistics(msg)
    ed.run_ed(msg)

    dicionario = {
    "^[!/]ip(?:@PintaoBot)?$": {
        "text": ["172.16.17.32 ou ts.lucasberti.me"]
    },
    "^[!/]mps(?:@PintaoBot)?$": {
        "text": [f"ok to calculando aki q esistem {str(randint(500, 10000))}/s por segundo de SUPER MAEMES NESNTE CHAT1"]
    },
    "^[!/]dougscore(?:@PintaoBot)?$": {
        "text": [f"ok to calculando aki q o dougscore é {str(randint(0, 100))}"]
    },
    "^[!/]stats(?:@PintaoBot)?$": {
        "text": [stats.return_statistics(chat)]
    },
    "^[!/]cartola(?:@PintaoBot)?$": {
        "text": ["-50 | -20 | -15 | -10 | -5 | 0 | +100"]
    },
    "^[!/]historia(?:@PintaoBot)?$": {
        "text": ["youtube.com/watch?v=ZkwdNcrIbxs"],
        "voice": ["AwADAQADRAADgBaoRzTp0hx182Z7Ag", "AwADAQADTwADRojZRSmcrD6Nylp7Ag"]
    },
    "^\?$": {
        "text": ["?"]
    },
    "^calma$": {
        "text": ["ok esto mais calmo obrigada"]
    },
    "^vc esta ai$": {
        "text": ["SIM, TÔ AQUI PORA"]
    },
    "^indignada$": {
        "voice": ["AwADAQADVwADMWFARkEqR2T39LDpAg"]
    },
    "^burn$": {
        "voice": ["AwADAQADPwADdMhpRu8AAd9hgtCNFwI", "AwADAQADQAADdMhpRusXWyvZVk-5Ag"]
    },
    "^axasdas$": {
        "text": [choice(["?", "!escolhe berti lixo ou berti top", "nunca fui sub do phantomlord"])],
        "sticker": ["CAADAQADOwADaXQpRqZjRHmRgc2XAg"]
    },
    "^geta$": {
        "sticker": ["CAADAQADRAADl6BoRbfstbst5IT7Ag"],
        "document": ["CQADAQADfwADx7KpRxytpuyVqkkJAg"],
        "photo": ["https://i.imgur.com/O5Ihe8x.png"]
    },
    "^rau$": {
        "text": ["meu pau no seu cu"],
        "voice": ["AwADAQADOgAD980QR0CE3Nf-ksRuAg"]
    },
    "^retcha$": {
        "voice": ["AwADAQADOgAD980QR0CE3Nf-ksRuAg"]
    },
    "^retchagemeno$": {
        "voice": ["AwADAQADDgADK3zfBXTMW4j5cqevAg"]
    },
    "^xischupano$": {
        "voice": ["AwADAQADEAADK3zfBeb564h2rREyAg"]
    }
}


    # Precisamos manter log de todas as mensagens pro /xet e /wordcloud
    with open("data/log.txt", "a", encoding='utf-8') as f:
        f.write(text + "\n")

    if chat == -1001299644323:
        with open("/var/www/html/xet.txt", "a", encoding='utf-8') as f:
            f.write(f"{msg['from']['username']}: {text}\n")


    if not stickers_loaded:
        try:
            with open("data/emotes.json") as f:
                emotes = json.load(f)
        except Exception as e:
            print(e)

    for emote, sticker in emotes.items():
        for word in text.split():
            if word == emote:
                send_sticker(chat, sticker)
                break


    if not arrobas_loaded:
        try:
            with open("data/arrobas.json") as f:
                arrobas = json.load(f)
        except Exception as e:
            print(e)

    for arroba in arrobas.keys():
        if arroba in text:
            send_message(chat, " ".join(arrobas[arroba]))
            if "giovannicardoso" in arrobas[arroba]:
                send_message(chat, "@giovannicardoso")

    for pat in dicionario:
        pattern = re.compile(pat)
        match = pattern.search(text)

        if match:
            if "text" in dicionario[pat].keys():
                for entry in dicionario[pat]["text"]:
                    send_message(chat, entry)
<commit_msg>Update multipurpose<commit_after># Plugin mais feio do mundo, mas é só pra um chat específico.
# Aqui temos comandos que são pequenos demais pra terem seu próprio módulo.

# Como esse plugin é ativado por todas as mensagens, o /stats também funcionará por aqui.

# A maioria é um port bem rápido de https://github.com/lucasberti/telegrao/blob/master/plugins/taup.lua

from api import send_message, send_sticker, send_document, send_photo, send_voice
from random import randint, choice, randrange
from datetime import datetime
import json
import re
from PIL import Image
import requests
import os
from io import BytesIO
import plugins.stats as stats
import plugins.ed as ed
import time

emotes = {}
arrobas = {}

stickers_loaded = False
arrobas_loaded = False


def on_msg_received(msg, matches):
    chat = msg["chat"]["id"]
    text = msg["text"]
    now = time.time()

    stats.do_statistics(msg)
    ed.run_ed(msg)

    dicionario = {
    "^[!/]ip(?:@PintaoBot)?$": {
        "text": ["172.16.17.32 ou ts.lucasberti.me"]
    },
    "^[!/]mps(?:@PintaoBot)?$": {
        "text": [f"ok to calculando aki q esistem {str(randint(500, 10000))}/s por segundo de SUPER MAEMES NESNTE CHAT1"]
    },
    "^[!/]dougscore(?:@PintaoBot)?$": {
        "text": [f"ok to calculando aki q o dougscore é {str(randint(0, 100))}"]
    },
    "^[!/]stats(?:@PintaoBot)?$": {
        "text": [stats.return_statistics(chat)]
    },
    "^[!/]cartola(?:@PintaoBot)?$": {
        "text": ["-50 | -20 | -15 | -10 | -5 | 0 | +100"]
    },
    "^[!/]historia(?:@PintaoBot)?$": {
        "text": ["youtube.com/watch?v=ZkwdNcrIbxs"],
        "voice": ["AwADAQADRAADgBaoRzTp0hx182Z7Ag", "AwADAQADTwADRojZRSmcrD6Nylp7Ag"]
    },
    "^\?$": {
        "text": ["?"]
    },
    "^calma$": {
        "text": ["ok esto mais calmo obrigada"]
    },
    "^vc esta ai$": {
        "text": ["SIM, TÔ AQUI PORA"]
    },
    "^indignada$": {
        "voice": ["AwADAQADVwADMWFARkEqR2T39LDpAg"]
    },
    "^burn$": {
        "voice": ["AwADAQADPwADdMhpRu8AAd9hgtCNFwI", "AwADAQADQAADdMhpRusXWyvZVk-5Ag"]
    },
    "^axasdas$": {
        "text": [choice(["?", "!escolhe berti lixo ou berti top", "nunca fui sub do phantomlord"])],
        "sticker": ["CAADAQADOwADaXQpRqZjRHmRgc2XAg"]
    },
    "^geta$": {
        "sticker": ["CAADAQADRAADl6BoRbfstbst5IT7Ag"],
        "document": ["CQADAQADfwADx7KpRxytpuyVqkkJAg"],
        "photo": ["https://i.imgur.com/O5Ihe8x.png"]
    },
    "^rau$": {
        "text": ["meu pau no seu cu"],
        "voice": ["AwADAQADOgAD980QR0CE3Nf-ksRuAg"]
    },
    "^retcha$": {
        "voice": ["AwADAQADOgAD980QR0CE3Nf-ksRuAg"]
    },
    "^retchagemeno$": {
        "voice": ["AwADAQADDgADK3zfBXTMW4j5cqevAg"]
    },
    "^xischupano$": {
        "voice": ["AwADAQADEAADK3zfBeb564h2rREyAg"]
    }
}


    # Precisamos manter log de todas as mensagens pro /xet e /wordcloud
    with open("data/log.txt", "a", encoding='utf-8') as f:
        f.write(text + "\n")

    if chat == -1001299644323:
        with open("/var/www/html/xet.txt", "a", encoding='utf-8') as f:
            f.write(f"{msg['from']['username']}: {text}\n")


    if not stickers_loaded:
        try:
            with open("data/emotes.json") as f:
                emotes = json.load(f)
        except Exception as e:
            print(e)

    for emote, sticker in emotes.items():
        for word in text.split():
            if word == emote:
                send_sticker(chat, sticker)
                break


    if not arrobas_loaded:
        try:
            with open("data/arrobas.json") as f:
                arrobas = json.load(f)
        except Exception as e:
            print(e)

    for arroba in arrobas.keys():
        if arroba in text:
            send_message(chat, " ".join(arrobas[arroba]))
            if "@giovannicardoso" in arrobas[arroba]:
                    send_message(chat, "@giovannicardoso")

    for pat in dicionario:
        pattern = re.compile(pat)
        match = pattern.search(text)

        if match:
            if "text" in dicionario[pat].keys():
                for entry in dicionario[pat]["text"]:
                    send_message(chat, entry)

{'fraction_non_alphanumeric': 0.15926327193932827, 'fraction_numerical': 0.021186950764415555, 'mean_word_length': 2.5054852320675107, 'pattern_counts': {'":': 78, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, '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': '2723842', 'n_tokens_mistral': 3398, 'n_tokens_neox': 3155, 'n_words': 677}