[core] Censor returns True if message is accepted
This commit is contained in:
parent
2ce11122c8
commit
3e565caf69
|
@ -122,11 +122,13 @@ class Censor:
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
message (Message): Message to distribute
|
message (Message): Message to distribute
|
||||||
|
Returns (Boolean): returns True if message is accepted by Censor.
|
||||||
"""
|
"""
|
||||||
if not await self.__is_appropriate(message):
|
if not await self.__is_appropriate(message):
|
||||||
return
|
return False
|
||||||
for censor in self.__hood_censors:
|
for censor in self.hood_censors:
|
||||||
await censor._inbox.put(message)
|
await censor.inbox.put(message)
|
||||||
|
return True
|
||||||
|
|
||||||
async def receive(self):
|
async def receive(self):
|
||||||
""" Receive a message.
|
""" Receive a message.
|
||||||
|
|
Loading…
Reference in a new issue