3
This commit is contained in:
+37
-27
@@ -32,51 +32,55 @@ class Message extends SmallProgram
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $content
|
* @param string $content
|
||||||
* @return Message
|
* @return Result
|
||||||
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function sendTextNews(string $content)
|
public function sendTextNews(string $content)
|
||||||
{
|
{
|
||||||
$this->msgData['msgtype'] = 'text';
|
$this->msgData['msgtype'] = 'text';
|
||||||
$this->msgData['text'] = ['content' => $content];
|
$this->msgData['text'] = ['content' => $content];
|
||||||
|
|
||||||
return $this;
|
return $this->sendKefuMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $media_id
|
* @param $media_id
|
||||||
* @return Message
|
* @return Result
|
||||||
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function sendImageNews(string $media_id)
|
public function sendImageNews(string $media_id)
|
||||||
{
|
{
|
||||||
$this->msgData['msgtype'] = 'image';
|
$this->msgData['msgtype'] = 'image';
|
||||||
$this->msgData['image'] = ['media_id' => $media_id];
|
$this->msgData['image'] = ['media_id' => $media_id];
|
||||||
|
|
||||||
return $this;
|
return $this->sendKefuMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $media_id
|
* @param $media_id
|
||||||
* @return Message
|
* @return Result
|
||||||
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function sendVoiceNews(string $media_id)
|
public function sendVoiceNews(string $media_id)
|
||||||
{
|
{
|
||||||
$this->msgData['msgtype'] = 'voice';
|
$this->msgData['msgtype'] = 'voice';
|
||||||
$this->msgData['voice'] = ['media_id' => $media_id];
|
$this->msgData['voice'] = ['media_id' => $media_id];
|
||||||
|
|
||||||
return $this;
|
return $this->sendKefuMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $media_id
|
* @param $media_id
|
||||||
* @return Message
|
* @return Result
|
||||||
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function sendMpNewsNews(string $media_id)
|
public function sendMpNewsNews(string $media_id)
|
||||||
{
|
{
|
||||||
$this->msgData['msgtype'] = 'mpnews';
|
$this->msgData['msgtype'] = 'mpnews';
|
||||||
$this->msgData['mpnews'] = ['media_id' => $media_id];
|
$this->msgData['mpnews'] = ['media_id' => $media_id];
|
||||||
|
|
||||||
return $this;
|
return $this->sendKefuMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -85,7 +89,8 @@ class Message extends SmallProgram
|
|||||||
* @param string $description
|
* @param string $description
|
||||||
* @param string $url
|
* @param string $url
|
||||||
* @param string $picurl
|
* @param string $picurl
|
||||||
* @return Message
|
* @return Result
|
||||||
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function sendNewsNews(string $title, string $description, string $url, string $picurl)
|
public function sendNewsNews(string $title, string $description, string $url, string $picurl)
|
||||||
{
|
{
|
||||||
@@ -96,20 +101,21 @@ class Message extends SmallProgram
|
|||||||
'url' => $url,
|
'url' => $url,
|
||||||
'picurl' => $picurl
|
'picurl' => $picurl
|
||||||
]]];
|
]]];
|
||||||
return $this;
|
return $this->sendKefuMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $title
|
* @param string $title
|
||||||
* @return Message
|
* @return Result
|
||||||
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function sendCardNews(string $title)
|
public function sendCardNews(string $title)
|
||||||
{
|
{
|
||||||
$this->msgData['msgtype'] = 'wxcard';
|
$this->msgData['msgtype'] = 'wxcard';
|
||||||
$this->msgData['wxcard'] = ['card_id' => $title];
|
$this->msgData['wxcard'] = ['card_id' => $title];
|
||||||
|
|
||||||
return $this;
|
return $this->sendKefuMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -118,7 +124,8 @@ class Message extends SmallProgram
|
|||||||
* @param string $thumb_media_id
|
* @param string $thumb_media_id
|
||||||
* @param string $title
|
* @param string $title
|
||||||
* @param string $description
|
* @param string $description
|
||||||
* @return Message
|
* @return Result
|
||||||
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function sendVideoNews(string $media_id, string $thumb_media_id, string $title, string $description)
|
public function sendVideoNews(string $media_id, string $thumb_media_id, string $title, string $description)
|
||||||
{
|
{
|
||||||
@@ -129,7 +136,7 @@ class Message extends SmallProgram
|
|||||||
'title' => $title,
|
'title' => $title,
|
||||||
'description' => $description
|
'description' => $description
|
||||||
]];
|
]];
|
||||||
return $this;
|
return $this->sendKefuMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -139,7 +146,8 @@ class Message extends SmallProgram
|
|||||||
* @param string $thumb_media_id
|
* @param string $thumb_media_id
|
||||||
* @param string $title
|
* @param string $title
|
||||||
* @param string $description
|
* @param string $description
|
||||||
* @return Message
|
* @return Result
|
||||||
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function sendMusicNews(string $musicurl, string $hqmusicurl, string $thumb_media_id, string $title, string $description)
|
public function sendMusicNews(string $musicurl, string $hqmusicurl, string $thumb_media_id, string $title, string $description)
|
||||||
{
|
{
|
||||||
@@ -151,7 +159,7 @@ class Message extends SmallProgram
|
|||||||
'hqmusicurl' => $hqmusicurl,
|
'hqmusicurl' => $hqmusicurl,
|
||||||
'thumb_media_id' => $thumb_media_id
|
'thumb_media_id' => $thumb_media_id
|
||||||
];
|
];
|
||||||
return $this;
|
return $this->sendKefuMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -159,7 +167,7 @@ class Message extends SmallProgram
|
|||||||
* @param string $head_content
|
* @param string $head_content
|
||||||
* @param string $tail_content
|
* @param string $tail_content
|
||||||
* @param array $menus
|
* @param array $menus
|
||||||
* @return Message
|
* @return Result
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function sendMenuNews(string $head_content, string $tail_content, array $menus = [])
|
public function sendMenuNews(string $head_content, string $tail_content, array $menus = [])
|
||||||
@@ -175,7 +183,7 @@ class Message extends SmallProgram
|
|||||||
foreach ($menus as $key => $val) {
|
foreach ($menus as $key => $val) {
|
||||||
$this->addNewsMenu($val['id'], $val['name']);
|
$this->addNewsMenu($val['id'], $val['name']);
|
||||||
}
|
}
|
||||||
return $this;
|
return $this->sendKefuMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int $index = 0;
|
private int $index = 0;
|
||||||
@@ -195,11 +203,12 @@ class Message extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $title
|
* @param $title
|
||||||
* @param string $appid
|
* @param $appid
|
||||||
* @param string $pagepath
|
* @param $pagepath
|
||||||
* @param string $thumb_media_id
|
* @param $thumb_media_id
|
||||||
* @return Message
|
* @return Result
|
||||||
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function sendMiniprogrampageNews(string $title, string $appid, string $pagepath, string $thumb_media_id)
|
public function sendMiniprogrampageNews(string $title, string $appid, string $pagepath, string $thumb_media_id)
|
||||||
{
|
{
|
||||||
@@ -210,7 +219,7 @@ class Message extends SmallProgram
|
|||||||
'pagepath' => $pagepath,
|
'pagepath' => $pagepath,
|
||||||
'thumb_media_id' => $thumb_media_id,
|
'thumb_media_id' => $thumb_media_id,
|
||||||
];
|
];
|
||||||
return $this;
|
return $this->sendKefuMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -270,6 +279,7 @@ class Message extends SmallProgram
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param $data
|
||||||
* @return Result
|
* @return Result
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user