From 8ccd35fda31772bbaff4eb8e91cc9a8b5916832d Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Tue, 28 Apr 2020 13:51:45 +0200 Subject: Meh --- escato.pl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/escato.pl b/escato.pl index 0f804ce..d0cded0 100755 --- a/escato.pl +++ b/escato.pl @@ -46,7 +46,8 @@ if ($tg_chat_id eq $tg_id || lc($text) =~ /^\@escatobot/) { } sub show_dumps { - $dbh ||= DBI->connect("DBI:SQLite:dbname=escato.db", { AutoCommit => 0, RaiseError => 1 }); + $dbh ||= DBI->connect("DBI:SQLite:dbname=escato.db", + { AutoCommit => 0, RaiseError => 1 }); my ($sec, $min, $hour) = localtime(); my $out; @@ -120,7 +121,8 @@ sub gen_graph { sub chat_members { my $tg_chat_id = shift; - $dbh ||= DBI->connect("DBI:SQLite:dbname=escato.db", { AutoCommit => 0, RaiseError => 1 }); + $dbh ||= DBI->connect("DBI:SQLite:dbname=escato.db", + { AutoCommit => 0, RaiseError => 1 }); my $sth = $dbh->prepare('SELECT U.id, U.username FROM tg_chat_users CU JOIN tg_users U ON U.id = CU.tg_id WHERE CU.tg_chat_id = ?'); $sth->execute($tg_chat_id); @@ -153,7 +155,8 @@ sub tg_id_dumps { } sub init_schema { - $dbh ||= DBI->connect("DBI:SQLite:dbname=escato.db", { AutoCommit => 0, RaiseError => 1 }); + $dbh ||= DBI->connect("DBI:SQLite:dbname=escato.db", + { AutoCommit => 0, RaiseError => 1 }); $dbh->prepare('CREATE TABLE tg_users ( id INTEGER PRIMARY KEY, username TEXT NOT NULL UNIQUE @@ -177,7 +180,8 @@ sub init_schema { } sub save_dump { - $dbh ||= DBI->connect("DBI:SQLite:dbname=escato.db", { AutoCommit => 0, RaiseError => 1 }); + $dbh ||= DBI->connect("DBI:SQLite:dbname=escato.db", + { AutoCommit => 0, RaiseError => 1 }); $dbh->prepare('INSERT OR REPLACE INTO tg_users VALUES (?, ?)') ->execute($tg_id, $tg_username); $dbh->prepare('INSERT OR IGNORE INTO tg_chats VALUES (?)') -- cgit v1.2.3