From 98486b062bcd7852c87eca5eadec5f708638d409 Mon Sep 17 00:00:00 2001 From: Sergei Fedosov Date: Thu, 5 Aug 2021 11:39:07 +0300 Subject: [PATCH] Perlcritic and update README.md --- .perlcriticrc | 3 +++ README.md | 4 ++++ lib/Bot/IRC.pm | 2 +- lib/Bot/IRC/OnMessage.pm | 2 ++ lib/IRCBot.pm | 4 ++-- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.perlcriticrc b/.perlcriticrc index d7e31fa..4ead187 100644 --- a/.perlcriticrc +++ b/.perlcriticrc @@ -98,3 +98,6 @@ lib_sections = NAME | VERSION | DESCRIPTION | AUTHOR | LICENSE AND COPYRIGHT [-ControlStructures::ProhibitDeepNests] # jabber bot lib have very nested structures that a bit fiddle to navigate :( + +[-BuiltinFunctions::ProhibitComplexMappings] +# so how I suppose to chomp() every damn string in array? diff --git a/README.md b/README.md index f243936..350d838 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,10 @@ It is based on Perl modules [Bot::IRC][1] and [Hailo][2] as conversation generator. +Module [Bot::IRC][1] is vendored and tailored to this particular bot because +of utf-8 issues in original source which are fix by hacking (yes, it is not +canonical/convinient way fix it, what done is already done). + Config located in **data/config.json**, sample config provided as **data/sample_config.json**. diff --git a/lib/Bot/IRC.pm b/lib/Bot/IRC.pm index dc95257..ef344a7 100644 --- a/lib/Bot/IRC.pm +++ b/lib/Bot/IRC.pm @@ -4,7 +4,7 @@ package Bot::IRC; use 5.014; use exact; -use Encode qw (_utf8_on _utf8_off encode_utf8 decode_utf8); +use Encode qw (_utf8_on _utf8_off); use Daemon::Device; use Date::Format 'time2str'; use IO::Socket::IP -register; diff --git a/lib/Bot/IRC/OnMessage.pm b/lib/Bot/IRC/OnMessage.pm index 2b5dae7..f725f39 100644 --- a/lib/Bot/IRC/OnMessage.pm +++ b/lib/Bot/IRC/OnMessage.pm @@ -196,3 +196,5 @@ sub init { 1; __END__ + +# vim: set ft=perl noet ai ts=4 sw=4 sts=4: \ No newline at end of file diff --git a/lib/IRCBot.pm b/lib/IRCBot.pm index b43997e..2cc2fe1 100644 --- a/lib/IRCBot.pm +++ b/lib/IRCBot.pm @@ -13,8 +13,6 @@ use version; our $VERSION = qw (1.0); use Exporter qw (import); our @EXPORT_OK = qw (RunIRCBot); -my $c = LoadConf (); - sub RunIRCBot { my $c = LoadConf (); @@ -50,6 +48,8 @@ sub RunIRCBot { } else { $bot->run; } + + return; }