From 879904a0f53781db50fb56a20bab8df92bfa7d10 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Tue, 11 Aug 2020 16:54:45 +0800 Subject: [PATCH] change event --- docs/.vuepress/public/logo.png | Bin 9052 -> 9454 bytes nonebot/adapters/__init__.py | 15 +++++++-------- nonebot/adapters/cqhttp.py | 25 ++++++++++++------------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/docs/.vuepress/public/logo.png b/docs/.vuepress/public/logo.png index 45857adacc0b9c5590375712bb5038d87ebfcc32..2b7e3815b5e9c1d38d691c3eacbaccb484d46264 100644 GIT binary patch literal 9454 zcmcI~^;cA1)cycU3Vi4WB_su;Q;;5d=uRnV7(f~X1VKQC?oN?LIs_5vp}Ul!dxoy} z@_yI){s-@@H9y>Q_Bngsb9X%Zx%acCx*|RIWXt$va>?F>9E7M>TtzT zYWBYC0RzzdfAvet9k+0kxLqN{Ed9N=XV-HSm|}W=bTs*p`ryv+Ks$~RBI+weTNPWs zzjfi@=blwEd%Ak?H`V3>`QXg|AnBLOJQi)9(K!$-e&w3=@Mid=$^71{*R}1^-)27X z^r$QS;i7Flm;GV2YU{!Gu$t>;r#GGd0f_=_Bb2U9Q|_o?RyoW^h|ebu_qm0lteZCX z1jyCBub0Tt{-b>Uy0*?Bp`$!nWCNOgW5>_68{P$a)`4P)`DJ#6S;KR_hp{kn*25iz z+r;1_#TNuG=wEQZc(XzbqGnP}45oFa(EgXWa|{`Soi}vVm>f$yNV3^-Vuoq2uz^yn zwg!`rqSb6H>3m`Bge;pa_vfc`Z&KFK(!SNKI|{1>45f zGIRP3JtT1r%|2CXEcYRwt&R`u=1P;2*CREiH)nCNL+iKgwDHh>RL6CrLuxA`K@`^& z5uDmGs{Sm}F&B4=d0@w*tGh)b!U48ndoq^99Gpb6aGsH})+=Q!BD57CA&o`mxDNKn z&r*=G{{yLt?AvS==rB-4ZVfbirz^6`eVbv1A7MAh^uC($=Yr>ng7 zjyOW0HCAH$j$9!&xO68zFgp11;#J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adapters/__init__.py b/nonebot/adapters/__init__.py index f7e6a3bd..1ce77bc0 100644 --- a/nonebot/adapters/__init__.py +++ b/nonebot/adapters/__init__.py @@ -4,10 +4,9 @@ import abc from functools import reduce from dataclasses import dataclass, field -from nonebot.rule import notice from nonebot.config import Config -from nonebot.typing import Dict, Union, Iterable, WebSocket +from nonebot.typing import Dict, Union, Optional, Iterable, WebSocket class BaseBot(abc.ABC): @@ -49,32 +48,32 @@ class BaseEvent(abc.ABC): @property @abc.abstractmethod - def type(self): + def type(self) -> str: raise NotImplementedError @type.setter @abc.abstractmethod - def type(self, value): + def type(self, value) -> None: raise NotImplementedError @property @abc.abstractmethod - def detail_type(self): + def detail_type(self) -> str: raise NotImplementedError @detail_type.setter @abc.abstractmethod - def detail_type(self, value): + def detail_type(self, value) -> None: raise NotImplementedError @property @abc.abstractmethod - def sub_type(self): + def sub_type(self) -> Optional[str]: raise NotImplementedError @sub_type.setter @abc.abstractmethod - def sub_type(self, value): + def sub_type(self, value) -> None: raise NotImplementedError diff --git a/nonebot/adapters/cqhttp.py b/nonebot/adapters/cqhttp.py index ee109468..ce68977a 100644 --- a/nonebot/adapters/cqhttp.py +++ b/nonebot/adapters/cqhttp.py @@ -58,14 +58,11 @@ class Bot(BaseBot): @overrides(BaseBot) async def handle_message(self, message: dict): - # TODO: convert message into event - event = Event(message) - - if not event: + if not message: return - # if "message" in event.keys(): - # event["message"] = Message(event["message"]) + # TODO: convert message into event + event = Event(message) await handle_event(self, event) @@ -98,37 +95,39 @@ class Bot(BaseBot): class Event(BaseEvent): def __init__(self, raw_event: dict): + if "message" in raw_event: + raw_event["message"] = Message(raw_event["message"]) super().__init__(raw_event) @property @overrides(BaseEvent) - def type(self): + def type(self) -> str: return self._raw_event["post_type"] @type.setter @overrides(BaseEvent) - def type(self, value): + def type(self, value) -> None: self._raw_event["post_type"] = value @property @overrides(BaseEvent) - def detail_type(self): + def detail_type(self) -> str: return self._raw_event[f"{self.type}_type"] @detail_type.setter @overrides(BaseEvent) - def detail_type(self, value): + def detail_type(self, value) -> None: self._raw_event[f"{self.type}_type"] = value @property @overrides(BaseEvent) - def sub_type(self): - return self._raw_event["sub_type"] + def sub_type(self) -> Optional[str]: + return self._raw_event.get("sub_type") @type.setter @overrides(BaseEvent) - def sub_type(self, value): + def sub_type(self, value) -> None: self._raw_event["sub_type"] = value