Files
zhamao-framework/src/ZM/Context/ContextInterface.php

101 lines
2.0 KiB
PHP
Raw Normal View History

<?php
2020-04-15 10:55:10 +08:00
declare(strict_types=1);
2020-04-15 10:55:10 +08:00
namespace ZM\Context;
2020-04-26 15:08:09 +08:00
use Swoole\Http\Request;
use Swoole\WebSocket\Frame;
use Swoole\WebSocket\Server;
use ZM\API\ZMRobot;
2020-08-31 10:11:06 +08:00
use ZM\ConnectionManager\ConnectionObject;
2020-04-26 15:08:09 +08:00
use ZM\Http\Response;
2020-04-15 10:55:10 +08:00
interface ContextInterface
{
2020-05-06 17:26:50 +08:00
public function __construct($cid);
2020-04-15 10:55:10 +08:00
2020-04-26 15:08:09 +08:00
/** @return Server */
2020-04-15 10:55:10 +08:00
public function getServer();
2020-04-26 15:08:09 +08:00
/** @return Frame */
2020-04-15 10:55:10 +08:00
public function getFrame();
2020-04-26 15:08:09 +08:00
/** @return mixed */
2020-04-15 10:55:10 +08:00
public function getData();
2020-05-06 17:26:50 +08:00
public function setData($data);
2020-08-31 10:11:06 +08:00
/** @return ConnectionObject */
2020-05-06 17:26:50 +08:00
public function getConnection();
/** @return null|int */
2020-05-06 17:26:50 +08:00
public function getFd();
2020-04-26 15:08:09 +08:00
/** @return int */
2020-04-15 10:55:10 +08:00
public function getCid();
2020-04-26 15:08:09 +08:00
/** @return Response */
2020-04-15 10:55:10 +08:00
public function getResponse();
2020-04-26 15:08:09 +08:00
/** @return Request */
2020-04-15 10:55:10 +08:00
public function getRequest();
/** @return ZMRobot */
public function getRobot();
2020-05-06 17:26:50 +08:00
/** @return mixed */
public function getUserId();
/** @return mixed */
public function getGroupId();
/** @return mixed */
public function getDiscussId();
/** @return string */
public function getMessageType();
/** @return mixed */
public function getRobotId();
/** @return mixed */
public function getMessage();
public function setMessage($msg);
public function setUserId($id);
public function setGroupId($id);
public function setDiscussId($id);
public function setMessageType($type);
2020-05-23 17:23:29 +08:00
public function getCQResponse();
2020-05-06 17:26:50 +08:00
public function reply($msg, $yield = false);
public function finalReply($msg, $yield = false);
public function waitMessage($prompt = '', $timeout = 600, $timeout_prompt = '');
2020-05-06 17:26:50 +08:00
public function getArgs($mode, $prompt_msg);
2020-05-06 17:26:50 +08:00
public function getNextArg($prompt_msg = '');
public function getFullArg($prompt_msg = '');
2020-05-06 17:26:50 +08:00
public function setCache($key, $value);
public function getCache($key);
public function cloneFromParent();
public function getNumArg($prompt_msg = '');
2020-05-06 17:26:50 +08:00
public function copy();
2020-11-08 19:40:16 +08:00
public function getOption();
2020-04-15 10:55:10 +08:00
}