+ !f, !ф, !fortune, !фортунка - show random phrase from fortune_mod db + !f 1, !ф 1, !fortune 1, !фортунка 1 - show fortune in chat at ~8 am + !f 0, !ф 0, !fortune 0, !фортунка 0 - do not show fortune in the morning + !f ?, !ф ?, !fortune ?, !фортунка ? - query morning fortune status
31 lines
576 B
Perl
31 lines
576 B
Perl
#!/usr/bin/perl
|
|
|
|
use 5.018;
|
|
use strict;
|
|
use warnings;
|
|
use utf8;
|
|
use open qw(:std :utf8);
|
|
use English qw( -no_match_vars );
|
|
use vars qw/$VERSION/;
|
|
$VERSION = '1.0';
|
|
|
|
my $workdir;
|
|
|
|
# before we run, change working dir
|
|
BEGIN {
|
|
use Cwd qw(chdir abs_path);
|
|
my @CWD = split /\//xms, abs_path ($PROGRAM_NAME);
|
|
if ($#CWD > 1) { $#CWD = $#CWD - 2; }
|
|
$workdir = join '/', @CWD;
|
|
chdir $workdir;
|
|
}
|
|
|
|
use lib ("$workdir/lib", "$workdir/vendor_perl", "$workdir/vendor_perl/lib/perl5");
|
|
use fortune qw(seed fortune);
|
|
use Carp;
|
|
$SIG{__DIE__} = sub { Carp::confess @_ };
|
|
|
|
seed ();
|
|
|
|
exit 0;
|