<?php class AccessSwedish extends AccessManager { public function isAllowedToTranslate(){ if($this->isUnwantedWord()) return false; $userID = $this->getTG()->message['from']['id']; if(!$this->isMemberOfChannel($userID)){ $this->getTG()->apiRequest ( "sendPhoto", array ( 'chat_id' => $userID, 'photo' => "http://towist.com/autoPost/images/loghatnamehsv.jpg", "caption" => "برای استفاده از لغتنامه، باید در کانال لغتنامه سوئدی عضو شد" .PHP_EOL."در غیر این صورت لغتنامه قادر به ترجمه لغات نمی باشد " .PHP_EOL."https://t.me/joinchat/AAAAAEhq7fHQgG24kNDgtg".PHP_EOL ) ); $this->getTG()->sendMessage("پس از عضویت در لینک کانال بالا به این صفحه برگردید، و لغت خود را در این صفحه وارد کنید",$this->message['from']['id']); return false; } if(!$this->canShowTranslated()){ return false; } return true; } public function isMemberOfChannel($userID){ $memberObject = $this->getTG()->apiRequest ( "getChatMember", array ( 'chat_id' => "@swedishfarsi", 'user_id' => $userID ) ); return strcmp($memberObject['status'], "member") == 0 || strcmp($memberObject['status'], "administrator") == 0 || strcmp($memberObject['status'], "creator") == 0; } } ?>
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
db | Folder | 0755 |
|
|
AccessSwedish.class.php | File | 1.37 KB | 0755 |
|
SwedisIntentService.class.php | File | 361 B | 0755 |
|
SwedishInviteInline.class.php | File | 1.6 KB | 0755 |
|
SwedishStart.intent.class.php | File | 2.36 KB | 0755 |
|
TTSSwedish.class.php | File | 1.57 KB | 0755 |
|
TranslateSwedish.class.php | File | 872 B | 0755 |
|
loaderswedish.php | File | 537 B | 0755 |
|