Skip to content

Commit

Permalink
💥 correct message segment mapping funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyongyu committed Aug 4, 2021
1 parent 3564228 commit 8e97a84
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nonebot/adapters/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from copy import deepcopy
from functools import partial
from typing_extensions import Protocol
from dataclasses import dataclass, field
from dataclasses import dataclass, field, asdict
from typing import (Any, Set, List, Dict, Type, Tuple, Union, TypeVar, Mapping,
Generic, Optional, Iterable)

Expand Down Expand Up @@ -281,22 +281,22 @@ def __setitem__(self, key: str, value: Any):
return setattr(self, key, value)

def __iter__(self):
yield from self.data.__iter__()
yield from asdict(self).keys()

def __contains__(self, key: Any) -> bool:
return key in self.data
return key in asdict(self).keys()

def get(self, key: str, default: Any = None):
return getattr(self, key, default)

def keys(self):
return self.data.keys()
return asdict(self).keys()

def values(self):
return self.data.values()
return asdict(self).values()

def items(self):
return self.data.items()
return asdict(self).items()

def copy(self: T) -> T:
return deepcopy(self)
Expand Down

0 comments on commit 8e97a84

Please sign in to comment.