forked from bot/app
🐛 移除liteyuki.channel.on_receive() wrapper对async和sync function的判断冗余代码
This commit is contained in:
parent
39a9c39924
commit
0fb5b84392
@ -157,16 +157,10 @@ class Channel:
|
||||
"""
|
||||
if receiver is None:
|
||||
for func in self._on_receive_funcs:
|
||||
if is_coroutine_callable(func):
|
||||
run_coroutine(func(data))
|
||||
else:
|
||||
func(data)
|
||||
else:
|
||||
for func in self._on_receive_funcs_with_receiver.get(receiver, []):
|
||||
if is_coroutine_callable(func):
|
||||
run_coroutine(func(data))
|
||||
else:
|
||||
func(data)
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
Loading…
Reference in New Issue
Block a user