diff --git a/joker.php b/joker.php index 721c7d4..b890bc4 100644 --- a/joker.php +++ b/joker.php @@ -66,6 +66,7 @@ new Joker\Plugin\QuoteInline( ['trigger'=> 'tg', 'limit' => 10] ), new Joker\Plugin\QuoteAdmin(), new Joker\Plugin\Stats( ['file' =>'data/log/log.json'] ), + new Joker\Plugin\Mastodon(), // *** somethingg wide, without triggers, must stay in the end *** diff --git a/src/Plugin/Mastodon.php b/src/Plugin/Mastodon.php index c4ae458..deff4cb 100644 --- a/src/Plugin/Mastodon.php +++ b/src/Plugin/Mastodon.php @@ -55,10 +55,10 @@ public function onPublicText( Update $update ) } else { - $this->subscribers[ $update->message()->chat()->id()] = $status; $update->replyMessage("Mastodon translation started, word to search: *$status*"); } + return false; } public function onTimer( Update $update ) diff --git a/src/Plugin/README.md b/src/Plugin/README.md index 4354b93..5f7a054 100644 --- a/src/Plugin/README.md +++ b/src/Plugin/README.md @@ -24,6 +24,7 @@ Plugins are well documented in inline comments, some interesting details will be * [Kicker Plugin](#kicker-plugin) * [Log Plugin](#log-plugin) * [Lurk Plugin](#lurk-plugin) +* [Mastodon Plugin](#mastodon-plugin) * [Meme Plugin](#meme-plugin) * [Moderate Plugin](#moderate-plugin) * [Pasta Plugin](#pasta-plugin) @@ -417,6 +418,18 @@ Answer will be parsed from Wikimedia article (suddenly not the best quality) Как это обычно бывает у нас… +## Mastodon Plugin + +Mastodon plugin for Joker + +Enable live translation of updates from Mastodon on your Telegram channel by typing: + + !mastodon abcd (abcd is a message you want to search in the updates) + +To disable translation, type: + + !mastodon off + ## Meme Plugin Create meme with [Memegen.link](https://memegen.link/) project.