From 1abb95622a8e1dcd58e76fad18f3394109d97f5e Mon Sep 17 00:00:00 2001 From: eleksir Date: Sun, 17 Oct 2021 01:14:38 +0300 Subject: [PATCH] Fix bunch of grammar mistakes --- .perlcriticrc | 3 +-- Migration.txt | 8 ++++---- README.md | 14 +++++++------- README_RU.md | 26 +++++++++++++------------- lib/BotLib.pm | 2 +- 5 files changed, 26 insertions(+), 27 deletions(-) diff --git a/.perlcriticrc b/.perlcriticrc index 41f004d..d43b43b 100644 --- a/.perlcriticrc +++ b/.perlcriticrc @@ -52,7 +52,7 @@ verbose = 8 [-ValuesAndExpressions::ProhibitEmptyQuotes] # cause we consider following correct and useful: my $var = ''; -# the recomended use of q{} looks too complex: my $var = q{}; +# the recommended use of q{} looks too complex: my $var = q{}; [-ValuesAndExpressions::ProhibitNoisyQuotes] # Other people, other opinions: "," is better readable than qw(,) @@ -92,4 +92,3 @@ lib_sections = NAME | VERSION | DESCRIPTION | AUTHOR | LICENSE AND COPYRIGHT [-ControlStructures::ProhibitDeepNests] # Have to use it, so fuckoff - diff --git a/Migration.txt b/Migration.txt index df3a55f..5e7f089 100644 --- a/Migration.txt +++ b/Migration.txt @@ -7,10 +7,10 @@ When you require to perform this procedure? Why do i have to perform this procedure? - Some modules are vendored with bot - BDB can vary its on-disk format depending on dbd version that linked with - perl interpreter itself and its apropriate module. + perl interpreter itself and its appropriate module. How can i guess that i miss to perform this procedure? -Most notable sympthom is 'BDB0091 DB_VERSION_MISMATCH' in logs and bot admin settings are lost. +Most notable symptom is 'BDB0091 DB_VERSION_MISMATCH' in logs and bot admin settings are lost. Procedure steps. @@ -22,8 +22,8 @@ On source system perform following steps: On target system perform these steps: 1. remove vendor_perl dir in bot' directory -2. run "bash bootstrap.sh" (no quotes) and wait until it suscessfuly build and - installl required modules. +2. run "bash bootstrap.sh" (no quotes) and wait until it successfully build and + install required modules. 3. run perl bin/cache_import.pl script. It should create cache and exit silently. diff --git a/README.md b/README.md index ff19d7f..66279b8 100644 --- a/README.md +++ b/README.md @@ -38,11 +38,11 @@ and all libraries should be downloaded, built, tested and installed. ## Running This bot does not [ultilize][4] webhooks, so in order to run it only well -internet connection is requied, no public-available ip address is needed. +internet connection is required, no public-available ip address is needed. ### Additional Settings to be performed in order to run bot as it designed -There are some "plugins" that requires registration on thrird party services +There are some "plugins" that requires registration on third party services and API keys and secrets in order to work. #### OpenWeatherMap @@ -58,13 +58,13 @@ It is still impossible to disable this plugin, but "I'm working on it". #### Imgur This plugin "just exists" and is actually used nowhere around the code. -Anyway, to make use of it besides registering apropriate handler in code, you +Anyway, to make use of it besides registering appropriate handler in code, you should sign in imgur and get access token. Actually at this time this "plugin" can be stub-ed with default config values. Anyway, to fetch access token you should [login][8] and perform [registration][9] -of your app. Then you should authorise your app according to [this][10] manual. Or +of your app. Then you should authorize your app according to [this][10] manual. Or [this][11] one. #### Flickr @@ -77,13 +77,13 @@ and secrets from flickr api. Before using it bot must be bootstrapped via **`bootstrap.sh`**. [Login][11] and create an [app][12] in your flickr account. Then *logout* flickr account. -(It is required in order to properly get "verfier" parameter later). +(It is required in order to properly get "verifier" parameter later). Put your [app key and secret][13] to **config.json**. Ensure that "verifier" parameter in Flickr-related part of config either absent or commented out. -Run **bin/flickr_init.pl** first time and follow on screen instuctions - copy and -paste given link to browser login to flickr account adn yo'll be redirected to +Run **bin/flickr_init.pl** first time and follow on screen instructions - copy and +paste given link to browser login to flickr account and you'll be redirected to example.com. Check address bar in browser to get so-called "verifier", put it in **config.json**. Then run **bin/flickr_init.pl** again to store API access token in db under data/image directory (in default config). You're done. diff --git a/README_RU.md b/README_RU.md index 18122d9..43017da 100644 --- a/README_RU.md +++ b/README_RU.md @@ -2,19 +2,19 @@ ## Что это такое -Это бот основанный на перловых модулях [Telegram::Bot][1] для работы в +Это бот, основанный на перловых модулях [Telegram::Bot][1] для работы в мессенджере Telegram и [Hailo][2] для генерации "умной" беседы. -Для корректной работы пришлось форкнуть [Telegram::Bot][1] чтобы обновить -интерфейс API до [Telegram Bot API v5][3]. Для избежания неоднозначностей модуль +Для корректной работы, пришлось форкнуть [Telegram::Bot][1], чтобы обновить +интерфейс API до [Telegram Bot API v5][3]. Для избежания неоднозначностей, модуль пришлось переименовать и теперь он идёт в составе бота. Возможно, когда модуль отлежится и будет похож на стабильный, он стнет самостоятельным и поселится на metacpan.org -Конфиг бота должен лежать в **data/config.json**, пример конфига расположен в +Конфиг бота должен лежать в **data/config.json**. Пример конфига расположен в **data/sample_config.json**. -Бота можно запустить через **bin/aleesa-telegram-bot** и он взлетит как юниксовый +Бота можно запустить через **bin/aleesa-telegram-bot** и он взлетит, как юниксовый демон (сделает двойной fork() и отцепится от stdio). ## Установка @@ -22,11 +22,11 @@ metacpan.org Чтобы запустить приложение, его надо "забурстрапить" - загрузить и собрать все необходимые зависимости. -Понадобится perl-5.18 а желательно новее, "Development Tools" или подобная +Понадобится perl-5.18, а желательно новее, "Development Tools" или подобная группа пакетов , perl, perl-devel, perl-local-lib, perl-app-cpanm, sqlite-devel, zlib-devel, openssl-devel, libdb4-devel (Berkeley DB devel), make. -После установки этих пакетов можно будет запустить: +После установки этих пакетов, можно будет запустить: ```bash @@ -34,7 +34,7 @@ bash bootstrap.sh ``` -и по идее всё что нужно будет выкачено, собрано и разложено куда надо. +и, по идее, всё что нужно будет выкачено, собрано и разложено куда надо. ## Запуск и работа @@ -49,7 +49,7 @@ bash bootstrap.sh #### OpenWeatherMap -Для работы погодного плагина надо [заргистрироваться][5], [залогиниться][6] и +Для работы погодного плагина, надо [заргистрироваться][5], [залогиниться][6] и [создать][7] api key. Free plan предлагает всё необхдимое для работы "плагина". Когда api key будет создан, его нужно вписать в **config.json** "секцию" @@ -70,7 +70,7 @@ openweathermap в качестве appid. На этом всё. "картиночных" командах бота. Есть скрипт, который поможет с регистрацией приложения в api Flickr - -**bin/flickr_init.pl** он достанет все нужные ключи и секреты к ним. +**bin/flickr_init.pl**, он достанет все нужные ключи и секреты к ним. До запуска этого скрипта, бот должен быть забутстраплен через **`bootstrap.sh`**. @@ -78,12 +78,12 @@ openweathermap в качестве appid. На этом всё. *разлогиньтесь*, это нужно, чтобы потом проще было достать параметр verifier. Запишите [app key и secret][13] в **config.json**. Удостоверьтесь, что параметр -"verifier" в конфиге либо закоменчен либо отсутствует. +"verifier" в конфиге либо закоменчен, либо отсутствует. Запустите **bin/flickr_init.pl** и следуте предлагаемым инструкциям - в итоге будет дана ссылка, которую надо скопипастить в браузер. По ссылке предложат -залогиниться, далее надо будет разрешить приложению просматривать профиль и -через один-два редиректа вы попадёте на example.com. Из адресной строки браузера +залогиниться, далее надо будет разрешить приложению просматривать профиль и, +через один-два редиректа, вы попадёте на example.com. Из адресной строки браузера надо скопировать параметр "verifier" и вписать его в **config.json**. Чтобы сохранить в бд плагина API access token для нормальной работы "плагина", diff --git a/lib/BotLib.pm b/lib/BotLib.pm index 61c848a..9d19c2e 100644 --- a/lib/BotLib.pm +++ b/lib/BotLib.pm @@ -45,7 +45,7 @@ sub RandomCommonPhrase { 'Повтори свой вопрос, не поняла', 'Выйди и зайди нормально', 'Я подумаю', - 'Даже не знаю что на это ответить', + 'Даже не знаю, что на это ответить', 'Ты упал такие вопросы девочке задавать?', 'Можно и так, но не уверена', 'А как ты думаешь?',