my.fbmessenger: add Sender protocol for consistency
This commit is contained in:
parent
58d2e25a42
commit
347cd1ef77
1 changed files with 13 additions and 2 deletions
|
@ -10,8 +10,16 @@ class Thread(Protocol):
|
||||||
@property
|
@property
|
||||||
def id(self) -> str: ...
|
def id(self) -> str: ...
|
||||||
|
|
||||||
# todo hmm it doesn't like it because one from .export is just str, not Optional...
|
@property
|
||||||
# name: Optional[str]
|
def name(self) -> Optional[str]: ...
|
||||||
|
|
||||||
|
|
||||||
|
class Sender(Protocol):
|
||||||
|
@property
|
||||||
|
def id(self) -> str: ...
|
||||||
|
|
||||||
|
@property
|
||||||
|
def name(self) -> Optional[str]: ...
|
||||||
|
|
||||||
|
|
||||||
class Message(Protocol):
|
class Message(Protocol):
|
||||||
|
@ -27,6 +35,9 @@ class Message(Protocol):
|
||||||
@property
|
@property
|
||||||
def thread(self) -> Thread: ...
|
def thread(self) -> Thread: ...
|
||||||
|
|
||||||
|
@property
|
||||||
|
def sender(self) -> Sender: ...
|
||||||
|
|
||||||
|
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
from more_itertools import unique_everseen
|
from more_itertools import unique_everseen
|
||||||
|
|
Loading…
Add table
Reference in a new issue