summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillermo Ramos2020-04-19 19:44:09 +0200
committerGuillermo Ramos2020-04-19 19:44:09 +0200
commite2c5ad94cefbd40a45a27fa3831af85e9ef3d6a1 (patch)
treedd5b78dd27bc56bf1826bf24ec64c1a4402b0f15
parentbdee66d712b2901ee812ea738ba754199d5f4873 (diff)
downloadbots-e2c5ad94cefbd40a45a27fa3831af85e9ef3d6a1.tar.gz
Update escato
-rwxr-xr-xescato.pl20
1 files changed, 15 insertions, 5 deletions
diff --git a/escato.pl b/escato.pl
index 1e23ce1..6fae8d9 100755
--- a/escato.pl
+++ b/escato.pl
@@ -13,15 +13,20 @@ my $text = <>;
# Indicios de que alguien ha cagado
my @DUMP_TRIGGERS = (
- "caga", "cagu", "jiñ", "vientr", "plant", "deposit", "bomb", "defec", # Verbos
- "pino", "pinaco", "ñordo", "truñ", "chusc", "caca", "caco", "baño",
- "mierda", "topo", "mojón", "zurullo", "wc", "roca", "retrete", # Sustantivos
- "a gust" # Otros
+ "caga", "cagu", "jiñ", "vientr", "plant", "deposit", "bomb", "defec",
+ "apunt", # Verbos
+ "tremend[ao]", "salvaj", # Adjetivos
+ "pino", "pinaco", "ñordo", "truñ", "chusc", "caca", "caco", "caqu", "baño",
+ "mierda", "topo", "mojón", "zurull", "wc", "roca", "retrete", "shit", # Sustantivos
+ "a gust", "otr[ao]", "💩" # Otros
);
my @PHRASES = (
"Estoy orgulloso de ti, %s.",
"¡Así se hace %s! 👏👏",
"¿Otra vez, %s? Tu salud intestinal es admirable, felicidades.",
+ "Te habrás quedado a gusto.",
+ "Sigue así %s, mostro, titán, coloso, crack, máquina, mastodonte, huracán.",
+ "%s Oh capitán, mi capitán.",
);
my $dbh;
@@ -58,6 +63,7 @@ sub show_dumps {
push @shures, {username => $shur->{'username'},
data => tg_id_dumps($shur->{'id'})};
}
+ my $graph = gen_graph(map { $_->{points} } @shures);
foreach my $shur (sort { $b->{data}{month} <=> $a->{data}{month} } @shures) {
printf "%d - @%s ha cagado %d veces este mes, y %d al año.\n",
$position++, $shur->{username}, $shur->{data}{month}, $shur->{data}{year};
@@ -65,6 +71,10 @@ sub show_dumps {
}
}
+sub gen_graph {
+ my $points = shift;
+}
+
sub chat_members {
my $tg_chat_id = shift;
$dbh ||= DBI->connect("DBI:SQLite:dbname=escato.db", { AutoCommit => 0, RaiseError => 1 });
@@ -137,7 +147,7 @@ sub save_dump {
(?, DATETIME("now"))')->execute($tg_id);
my (undef, undef, undef, $mday, $mon) = localtime();
my $phrase = sprintf $PHRASES[rand @PHRASES], "@" . $tg_username;
- if ($mday == 9 && $mon == 2) {
+ if ($mday == 8 && $mon == 2) {
$phrase =~ s/o([a-z]?([^a-z]|$))/e$1/g;
}
print $phrase;