This repository was archived by the owner on Aug 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ using nlohmann::json;
3131#ifdef CreateEvent
3232#undef CreateEvent
3333#endif
34+ #ifdef SetPort
35+ #undef SetPort
36+ #endif
3437
3538namespace Cyan
3639{
@@ -44,8 +47,22 @@ namespace Cyan
4447 * \param port port
4548 */
4649 MiraiBot (const string& host, int port);
50+ MiraiBot (const MiraiBot&) = delete ;
51+ MiraiBot& operator =(const MiraiBot&) = delete ;
4752 ~MiraiBot ();
4853
54+ /* *
55+ * \brief 设置 Host
56+ * \param host Host
57+ * \return MiraiBot 引用
58+ */
59+ MiraiBot& SetHost (const string& host);
60+ /* *
61+ * \brief 设置 Port
62+ * \param port Port
63+ * \return MiraiBot 引用
64+ */
65+ MiraiBot& SetPort (int port);
4966 /* *
5067 * \brief 获得 mirai-cpp 适配的 API 版本
5168 * \return 用数字表示的版本号 (10605)
Original file line number Diff line number Diff line change @@ -30,6 +30,19 @@ namespace Cyan
3030 {
3131 Release ();
3232 }
33+
34+ MiraiBot& MiraiBot::SetHost (const string& host)
35+ {
36+ this ->host_ = host;
37+ return *this ;
38+ }
39+
40+ MiraiBot& MiraiBot::SetPort (int port)
41+ {
42+ this ->port_ = port;
43+ return *this ;
44+ }
45+
3346 string MiraiBot::GetSessionKey () const
3447 {
3548 return sessionKey_;
You can’t perform that action at this time.
0 commit comments