33namespace Hopex \VkSdk \Foundation \Core \Server ;
44
55use Hopex \VkSdk \Contracts \ServerEventsContract ;
6+ use Hopex \VkSdk \Exceptions \Api \ApiException ;
67use Hopex \VkSdk \Exceptions \SourceQuery \AuthenticationSourceQueryException ;
78use Hopex \VkSdk \Exceptions \SourceQuery \InvalidArgumentSourceQueryException ;
89use Hopex \VkSdk \Exceptions \SourceQuery \InvalidPacketSourceQueryException ;
@@ -46,7 +47,10 @@ public function __construct()
4647 }
4748
4849 /**
49- * @inheritDoc
50+ * @param Message $message
51+ * @return void
52+ * @throws ApiException
53+ * @throws Throwable
5054 */
5155 public function server_message_new (Message $ message ): void
5256 {
@@ -60,7 +64,10 @@ public function server_message_new(Message $message): void
6064 }
6165
6266 /**
63- * @inheritDoc
67+ * @param Mute $mute
68+ * @return void
69+ * @throws ApiException
70+ * @throws Throwable
6471 */
6572 public function server_mute_new (Mute $ mute ): void
6673 {
@@ -78,7 +85,10 @@ public function server_mute_new(Mute $mute): void
7885 }
7986
8087 /**
81- * @inheritDoc
88+ * @param Ban $ban
89+ * @return void
90+ * @throws ApiException
91+ * @throws Throwable
8292 */
8393 public function server_ban_new (Ban $ ban ): void
8494 {
@@ -140,26 +150,15 @@ public function requestStatistics(int $groupId): void
140150 public function messageSendToServer (int $ groupId , int $ peerId , string $ name , string $ text ): void
141151 {
142152 $ this ->logger ->info ("ServerMessage \"$ text \" from \"$ name \" has been send to server by group $ groupId " );
143- // $this->sourceQueryCall($groupId, 'sm_chat_say "' . $name . '" "' . $text . '"');
144153 $ this ->sourceQueryCall ($ groupId , "sm_chat_say \"$ name \" \"$ text \"" );
145-
146- VkApi::message (Session::get ('group_token ' ))
147- ->send ((new MessageRequestFields ())
148- ->setPeerId ($ peerId )
149- ->setDisableMentions (true )
150- ->setDontParseLinks (true )
151- ->setMessage (str_replace ([
152- '%PLAYER% ' ,
153- '%MESSAGE% '
154- ], [
155- $ name ,
156- $ text
157- ], Note::get ('server.messages.to-server ' )))
158- );
159154 }
160155
161156 /**
162- * @inheritDoc
157+ * @param ServerEvent $event
158+ * @param string $message
159+ * @return void
160+ * @throws Throwable
161+ * @throws ApiException
163162 */
164163 public function messageSendToVk (ServerEvent $ event , string $ message ): void
165164 {
0 commit comments