]> git.localhorst.tv Git - alttp.git/blobdiff - app/Console/Commands/ChatlibDatabase.php
add known bot
[alttp.git] / app / Console / Commands / ChatlibDatabase.php
index e492bb7c1169160fafea1c9a938aec7f5b0c8b86..9bf143f11e9956d188f81c4e241ba6a749e57876 100644 (file)
@@ -13,7 +13,7 @@ class ChatlibDatabase extends Command {
         *
         * @var string
         */
-       protected $signature = 'chatlib:database {which=de} {size=7}';
+       protected $signature = 'chatlib:database {which=de} {size=3}';
 
        /**
         * The console command description.
@@ -44,10 +44,13 @@ class ChatlibDatabase extends Command {
                                $query->whereNull('detected_language');
                                $query->orWhere('detected_language', '=', $lang);
                        })
-                       ->whereRaw('LENGTH(`text_content`) > 10')
+                       ->orderBy('channel_id')
+                       ->orderBy('created_at')
                        ->chunk(5000, function ($msgs) use (&$count, $db) {
+                               $previous = null;
                                foreach ($msgs as $msg) {
-                                       $db->addMessage($msg);
+                                       $db->addMessage($msg, $previous);
+                                       $previous = $msg;
                                        ++$count;
                                }
                                $this->line($count);