Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit 2814a41

Browse files
committed
更新所有events实现;
1 parent 2d1401e commit 2814a41

24 files changed

+1
-174
lines changed

include/events/bot_join_group.hpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,19 @@ namespace Cyan
2020
return MiraiEvent::BotJoinGroupEvent;
2121
}
2222

23-
virtual void SetMiraiBot(MiraiBot* bot) override
24-
{
25-
this->bot_ = bot;
26-
}
27-
2823
virtual bool Set(const json& j) override
2924
{
3025
this->Group.Set(j["group"]);
3126
return true;
3227
}
28+
3329
virtual json ToJson() const override
3430
{
3531
json j = json::object();
3632
j["type"] = "BotJoinGroupEvent";
3733
j["group"] = this->Group.ToJson();
3834
return j;
3935
}
40-
41-
private:
42-
MiraiBot* bot_;
4336
};
4437

4538
}

include/events/bot_leave_active.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ namespace Cyan
2020
return MiraiEvent::BotLeaveEventActive;
2121
}
2222

23-
virtual void SetMiraiBot(MiraiBot* bot) override
24-
{
25-
this->bot_ = bot;
26-
}
27-
2823
virtual bool Set(const json& j) override
2924
{
3025
this->Group.Set(j["group"]);
@@ -37,9 +32,6 @@ namespace Cyan
3732
j["group"] = this->Group.ToJson();
3833
return j;
3934
}
40-
41-
private:
42-
MiraiBot* bot_;
4335
};
4436

4537
}

include/events/bot_leave_kick.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ namespace Cyan
2020
return MiraiEvent::BotLeaveEventKick;
2121
}
2222

23-
virtual void SetMiraiBot(MiraiBot* bot) override
24-
{
25-
this->bot_ = bot;
26-
}
27-
2823
virtual bool Set(const json& j) override
2924
{
3025
this->Group.Set(j["group"]);
@@ -38,8 +33,6 @@ namespace Cyan
3833
return j;
3934
}
4035

41-
private:
42-
MiraiBot* bot_;
4336
};
4437

4538
}

include/events/bot_mute_event.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ namespace Cyan
2121
return MiraiEvent::BotMuteEvent;
2222
}
2323

24-
virtual void SetMiraiBot(MiraiBot* bot) override
25-
{
26-
this->bot_ = bot;
27-
}
28-
2924
virtual bool Set(const json& j) override
3025
{
3126
this->DurationSeconds = j["durationSeconds"].get<int>();
@@ -41,8 +36,6 @@ namespace Cyan
4136
return j;
4237
}
4338

44-
private:
45-
MiraiBot* bot_;
4639
};
4740

4841
}

include/events/bot_offline_active.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ namespace Cyan
2020
return MiraiEvent::BotOfflineEventActive;
2121
}
2222

23-
virtual void SetMiraiBot(MiraiBot* bot) override
24-
{
25-
this->bot_ = bot;
26-
}
27-
2823
virtual bool Set(const json& j) override
2924
{
3025
this->QQ = (QQ_t)(j["qq"].get<int64_t>());
@@ -37,9 +32,6 @@ namespace Cyan
3732
j["qq"] = (int64_t)this->QQ;
3833
return j;
3934
}
40-
41-
private:
42-
MiraiBot* bot_;
4335
};
4436

4537
}

include/events/bot_offline_dropped.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ namespace Cyan
2020
return MiraiEvent::BotOfflineEventDropped;
2121
}
2222

23-
virtual void SetMiraiBot(MiraiBot* bot) override
24-
{
25-
this->bot_ = bot;
26-
}
27-
2823
virtual bool Set(const json& j) override
2924
{
3025
this->QQ = (QQ_t)(j["qq"].get<int64_t>());
@@ -37,9 +32,6 @@ namespace Cyan
3732
j["qq"] = (int64_t)this->QQ;
3833
return j;
3934
}
40-
41-
private:
42-
MiraiBot* bot_;
4335
};
4436

4537
}

include/events/bot_offline_force.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ namespace Cyan
2020
return MiraiEvent::BotOfflineEventForce;
2121
}
2222

23-
virtual void SetMiraiBot(MiraiBot* bot) override
24-
{
25-
this->bot_ = bot;
26-
}
27-
2823
virtual bool Set(const json& j) override
2924
{
3025
this->QQ = (QQ_t)(j["qq"].get<int64_t>());
@@ -37,9 +32,6 @@ namespace Cyan
3732
j["qq"] = (int64_t)this->QQ;
3833
return j;
3934
}
40-
41-
private:
42-
MiraiBot* bot_;
4335
};
4436

4537
}

include/events/bot_online_event.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ namespace Cyan
2020
return MiraiEvent::BotOnlineEvent;
2121
}
2222

23-
virtual void SetMiraiBot(MiraiBot* bot) override
24-
{
25-
this->bot_ = bot;
26-
}
27-
2823
virtual bool Set(const json& j) override
2924
{
3025
this->QQ = (QQ_t)(j["qq"].get<int64_t>());
@@ -38,8 +33,6 @@ namespace Cyan
3833
return j;
3934
}
4035

41-
private:
42-
MiraiBot* bot_;
4336
};
4437

4538
}

include/events/bot_relogin_event.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ namespace Cyan
2020
return MiraiEvent::BotReloginEvent;
2121
}
2222

23-
virtual void SetMiraiBot(MiraiBot* bot) override
24-
{
25-
this->bot_ = bot;
26-
}
27-
2823
virtual bool Set(const json& j) override
2924
{
3025
this->QQ = (QQ_t)(j["qq"].get<int64_t>());
@@ -37,9 +32,6 @@ namespace Cyan
3732
j["qq"] = (int64_t)this->QQ;
3833
return j;
3934
}
40-
41-
private:
42-
MiraiBot* bot_;
4335
};
4436

4537
}

include/events/bot_unmute_event.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ namespace Cyan
2222
return MiraiEvent::BotUnmuteEvent;
2323
}
2424

25-
virtual void SetMiraiBot(MiraiBot* bot) override
26-
{
27-
this->bot_ = bot;
28-
}
29-
3025
virtual bool Set(const json& j) override
3126
{
3227
this->Operator.Set(j["operator"]);
@@ -40,8 +35,6 @@ namespace Cyan
4035
return j;
4136
}
4237

43-
private:
44-
MiraiBot* bot_;
4538
};
4639

4740
}

0 commit comments

Comments
 (0)