cpp-mirai-client  v2.6.1
cpp client for mirai-api-http
NudgeEvent.hpp
浏览该文件的文档.
1// Copyright (C) 2022 Numendacil and contributors
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as
5// published by the Free Software Foundation, either version 3 of the
6// License, or (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16#ifndef MIRAI_NUDGE_EVENT_HPP_
17#define MIRAI_NUDGE_EVENT_HPP_
18
19#include <string>
20
23
24#include "IEvent.hpp"
25
26namespace Mirai
27{
28
29/**
30 * @brief 戳一戳事件
31 *
32 * Member Variable | Default Value
33 * --------------- | -------------
34 * `NudgeEvent::FromId_` | `0_qq`
35 * `NudgeEvent::target_` | `NudgeTarget{}`
36 * `NudgeEvent::action_` | `""`
37 * `NudgeEvent::suffix_` | `""`
38 */
39class NudgeEvent final : public IEvent<NudgeEvent>
40{
41 friend IEvent<NudgeEvent>;
42private:
43 QQ_t FromId_;
44 NudgeTarget target_;
45 std::string action_;
46 std::string suffix_;
47
48 static constexpr EventTypes TYPE_ = EventTypes::Nudge;
49
50public:
51 /// 获取发送者QQ
52 QQ_t GetSender() const { return this->FromId_; }
53 /// 获取戳一戳消息的接收对象
54 NudgeTarget GetTarget() const { return this->target_; }
55 /// 获取自定义戳一戳的动作消息
56 std::string GetAction() const { return this->action_; }
57 /// 获取自定义戳一戳的内容
58 std::string GetSuffix() const { return this->suffix_; }
59
60 struct Serializable;
61};
62
63template<>
65{
67};
68
69} // namespace Mirai
70
71
72#endif
Common interface for all event types
Definition: IEvent.hpp:34
戳一戳事件
Definition: NudgeEvent.hpp:40
QQ_t GetSender() const
获取发送者QQ
Definition: NudgeEvent.hpp:52
std::string GetAction() const
获取自定义戳一戳的动作消息
Definition: NudgeEvent.hpp:56
NudgeTarget GetTarget() const
获取戳一戳消息的接收对象
Definition: NudgeEvent.hpp:54
std::string GetSuffix() const
获取自定义戳一戳的内容
Definition: NudgeEvent.hpp:58
QQ移动端头像戳一戳动作的对象
Definition: NudgeTarget.hpp:37
QQ号码类型
Definition: BasicTypes.hpp:71
所有mirai相关的对象的命名空间
用于类型之间转换的辅助模板
Definition: EventTypes.hpp:107
用于类型之间转换的辅助模板