summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillermo Ramos2020-04-28 13:51:45 +0200
committerGuillermo Ramos2021-07-30 13:36:10 +0200
commit8ccd35fda31772bbaff4eb8e91cc9a8b5916832d (patch)
tree8cac0d30dc137fd4575f90d5d06fb2a4915ca5bf
parentbb10bd4c3c123d3b328b59419c67237429f8e485 (diff)
downloadbots-8ccd35fda31772bbaff4eb8e91cc9a8b5916832d.tar.gz
Meh
-rwxr-xr-xescato.pl12
1 files 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 (?)')