-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
82 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
|
||
// Src | ||
foreach (glob(__DIR__ . '/src/*') as $filename) | ||
require_once $filename; | ||
require_once $filename; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"isRemove":false,"deleteTime":1612882798,"temp":[110917,110916,110915,110913,110908,110903,110902,110899,110896,110893,110972,110970,110968,110966,110962]} | ||
{"isRemove":false,"deleteTime":1612882798,"temp":[]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
# ❤️ Лайки (Likes) | ||
|
||
### Поставить лайк | ||
|
||
С помощью этой функции можно поставить лайк куда угодно. | ||
|
||
```php | ||
``` php | ||
// $type — Тип контента (wall | photo и т.д) | ||
// $owner_id — Айди владельца записи | ||
// $item_id — Айди записи | ||
add(string $type, int $owner_id, int $item_id) | ||
|
||
// Пример | ||
$user->getLikes()->add('photo', -1, 1); | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
# ✉️ Сообщения (Messages) | ||
|
||
### Отправить сообщение | ||
|
||
Без комментариев. | ||
|
||
```php | ||
``` php | ||
// $text — Текст сообщения | ||
// $peer_ids — Айди беседы / пользователя (можно сделать рассылку, указав айди как String через запятую "1,2,3,4,5,6,7") | ||
// $args — (Необязательно) Дополнительные параметры | ||
sendMessage(string $text, $peer_ids, array $args = []) | ||
|
||
// Пример | ||
$user->getMessages()->sendMessage('привет лох', 1); | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
# 🧱 Стена (Wall) | ||
|
||
### Мониторинг стены | ||
|
||
Короче говоря, бот смотрит стену и при любом движе сообщит вам. Удобная штука, для никому не нужных первонахов в комментариях и т.д. | ||
|
||
```php | ||
``` php | ||
// owner_id — Айди группы / страницы | ||
// $call — Callback | ||
// $sleep — Время задержки в секундах (рекомендую 60-300 сек | потому что летит флуд контроль с токена пользователя) | ||
listen($owner_id, $call, int $sleep) | ||
|
||
// Пример | ||
$user->getWall()->listen(-1, function($data) use ($user) { | ||
// $data — Все данные поста | ||
// $data — Все данные поста | ||
}, 60); | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
<?php | ||
|
||
class Account { | ||
|
||
private $user; | ||
|
||
public function __construct(User $user) { | ||
$this->user = $user; | ||
} | ||
|
||
public function getId() { | ||
return $this->user->VkApiRequest()->api('account.getProfileInfo', [])['id']; | ||
} | ||
|
||
public function ban(int $owner_id = 1) { | ||
return $this->user->VkApiRequest()->api('account.ban', ['owner_id' => $owner_id]); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
<?php | ||
|
||
class Likes { | ||
|
||
private $user; | ||
|
||
public function __construct(User $user) { | ||
$this->user = $user; | ||
} | ||
|
||
public function add(string $type, int $owner_id, int $item_id) { | ||
return $this->user->VkApiRequest()->api('likes.add', [ | ||
'type' => $type, | ||
'owner_id' => $owner_id, | ||
'item_id' => $item_id | ||
]); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
<?php | ||
|
||
class Messages { | ||
|
||
private $user; | ||
|
||
public function __construct(User $user) { | ||
$this->user = $user; | ||
} | ||
|
||
public function sendMessage(string $text, $peer_ids, array $args = []) { | ||
return $this->user->VkApiRequest()->api('messages.send', [ | ||
'random_id' => rand(), | ||
'peer_ids' => $peer_ids, | ||
'message' => $text | ||
] + $args); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,44 @@ | ||
<?php | ||
|
||
class User { | ||
|
||
private $VkApiRequest; | ||
private $Account; | ||
private $Wall; | ||
private $Likes; | ||
private $Messages; | ||
|
||
public $token; | ||
public $v; | ||
|
||
public function __construct(string $token, $v = 5.126) { | ||
$this->token = $token; | ||
$this->v = $v; | ||
|
||
$this->VkApiRequest = new VkApiRequest($this); | ||
$this->Account = new Account($this); | ||
$this->Wall = new Wall($this); | ||
$this->Likes = new Likes($this); | ||
$this->Messages = new Messages($this); | ||
} | ||
|
||
public function VkApiRequest(): VkApiRequest { | ||
return $this->VkApiRequest; | ||
} | ||
|
||
public function getAccount(): Account { | ||
return $this->Account; | ||
} | ||
|
||
public function getWall(): Wall { | ||
return $this->Wall; | ||
} | ||
|
||
public function getLikes(): Likes { | ||
return $this->Likes; | ||
} | ||
|
||
public function getMessages(): Messages { | ||
return $this->Messages; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.