<commit_before><?php
namespace BenBot;
error_reporting(-1);

use Discord\Discord;
use Discord\Parts\User\Game;
use Discord\Parts\Embed\Embed;

use BenBot\Utils;
use BenBot\PersistentArray;
use BenBot\Command;
use BenBot\Commands;
use BenBot\FontConverter;

use Carbon\Carbon;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Dotenv\Dotenv;
use function Stringy\create as s;


class BenBot extends Discord {

    public $start_time;
    public $dir;
    public $defs;
    public $imgs;
    public $cities;
    public $emails;
    public $jokes;
    public $yomamajokes;
    public $copypastas;
    public $devbot;
    public $chatgame;

    protected $help;
    protected $game;
    protected $banner;
    protected $cmds    = [];
    protected $aliases = [];

    public function __construct($dir)
    {

        (new Dotenv($dir))->load();

        parent::__construct([
            'token'          => getenv('DISCORD_TOKEN'),
            'pmChannels'     => true,
            'loadAllMembers' => true,
        ]);

        $this->dir         = $dir;
        $this->help        = [];
        $this->jokes       = explode("---", file_get_contents("$dir/miscjokes.txt"));
        $this->copypastas  = explode("---", file_get_contents("$dir/copypasta.txt"));
        $this->yomamajokes = file("$dir/yomamajokes.txt");
        $this->banner      = file_get_contents("{$this->dir}/banner.txt");
        $this->devbot      = true;
        $this->chatgame    = [];


        $this->game = $this->factory(Game::class, [
            'name' => 'type ;help for info',
        ]);

        try {
            $this->defs   = new PersistentArray("$dir/bot_data/defs.mp");
            $this->imgs   = new PersistentArray("$dir/bot_data/img_urls.mp");
            $this->cities = new PersistentArray("$dir/bot_data/cities.mp");
            $this->emails = new PersistentArray("$dir/bot_data/emails.mp");
        } catch (Exception $e) {
            echo 'Caught exception: ', $e->getMessage(), PHP_EOL;
        }

///////////////////////////////////////////////////////////////////////////////////////////////////
        $this->on('ready', function () {
            Utils::init($this);
            FontConverter::init();
            $this->updatePresence($this->game);

///////////////////////////////////////////////////////////////////////////////////////////////////
            $this->on('message', function ($msg) {
                $str = s($msg->content);
                if (!$msg->author->bot) {<commit_msg>disable devbot<commit_after><?php
namespace BenBot;
error_reporting(-1);

use Discord\Discord;
use Discord\Parts\User\Game;
use Discord\Parts\Embed\Embed;

use BenBot\Utils;
use BenBot\PersistentArray;
use BenBot\Command;
use BenBot\Commands;
use BenBot\FontConverter;

use Carbon\Carbon;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Dotenv\Dotenv;
use function Stringy\create as s;


class BenBot extends Discord {

    public $start_time;
    public $dir;
    public $defs;
    public $imgs;
    public $cities;
    public $emails;
    public $jokes;
    public $yomamajokes;
    public $copypastas;
    public $devbot;
    public $chatgame;

    protected $help;
    protected $game;
    protected $banner;
    protected $cmds    = [];
    protected $aliases = [];

    public function __construct($dir)
    {

        (new Dotenv($dir))->load();

        parent::__construct([
            'token'          => getenv('DISCORD_TOKEN'),
            'pmChannels'     => true,
            'loadAllMembers' => true,
        ]);

        $this->dir         = $dir;
        $this->help        = [];
        $this->jokes       = explode("---", file_get_contents("$dir/miscjokes.txt"));
        $this->copypastas  = explode("---", file_get_contents("$dir/copypasta.txt"));
        $this->yomamajokes = file("$dir/yomamajokes.txt");
        $this->banner      = file_get_contents("{$this->dir}/banner.txt");
        $this->devbot      = false;
        $this->chatgame    = [];


        $this->game = $this->factory(Game::class, [
            'name' => 'type ;help for info',
        ]);

        try {
            $this->defs   = new PersistentArray("$dir/bot_data/defs.mp");
            $this->imgs   = new PersistentArray("$dir/bot_data/img_urls.mp");
            $this->cities = new PersistentArray("$dir/bot_data/cities.mp");
            $this->emails = new PersistentArray("$dir/bot_data/emails.mp");
        } catch (Exception $e) {
            echo 'Caught exception: ', $e->getMessage(), PHP_EOL;
        }

///////////////////////////////////////////////////////////////////////////////////////////////////
        $this->on('ready', function () {
            Utils::init($this);
            FontConverter::init();
            $this->updatePresence($this->game);

///////////////////////////////////////////////////////////////////////////////////////////////////
            $this->on('message', function ($msg) {
                $str = s($msg->content);
                if (!$msg->author->bot) {
{'fraction_non_alphanumeric': 0.2232391563867887, 'fraction_numerical': 0.0003979307600477517, 'mean_word_length': 1.7651265126512652, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '295293', 'n_tokens_mistral': 1503, 'n_tokens_neox': 1470, 'n_words': 271}