Add structure for methods for member join and leave

This commit is contained in:
Ceda EI 2018-04-04 19:33:20 +05:30
parent 229a343ebd
commit 6c4fa4848c
1 changed files with 10 additions and 0 deletions

View File

@ -62,6 +62,16 @@ $modules = array(
$command_list = explode(" ", $decoded->{"message"}->{"text"}); $command_list = explode(" ", $decoded->{"message"}->{"text"});
# Run new_member function for a new member
if (isset($decoded->{'message'}->{'new_chat_members'})) {
new_member();
}
# Run member_exit function when a member leaves
if (isset($decoded->{'message'}->{"left_chat_member"})) {
member_exit();
}
foreach ($modules as $module ) { foreach ($modules as $module ) {
if (check_command($module["command"])) { if (check_command($module["command"])) {
eval($module["function"]); eval($module["function"]);