Add !admin greet command

This commit is contained in:
eleksir
2022-03-06 00:08:34 +03:00
parent 7e5fbba0d0
commit de2106b16b
3 changed files with 118 additions and 5 deletions

View File

@@ -12,7 +12,7 @@ use Log::Any qw ($log);
use Math::Random::Secure qw (irand);
use Mojo::Base 'Teapot::Bot::Brain';
use BotLib::Admin qw (FortuneToggleList ChanMsgEnabled);
use BotLib::Admin qw (FortuneToggleList ChanMsgEnabled GreetMsgEnabled);
use BotLib qw (Command Highlight BotSleep IsCensored);
use BotLib::Conf qw (LoadConf);
use BotLib::Util qw (trim fmatch);
@@ -127,6 +127,11 @@ sub __on_msg {
# Newcommer event, greet our new member and suggest to introduce themself.
if ($msg->can ('new_chat_members') && defined ($msg->new_chat_members)) {
unless (GreetMsgEnabled ($chatid)) {
return;
}
my @members;
my @introduce = (
'Дратути',