Tunnel - Send message after close (#2507)

This commit is contained in:
jack1142 2019-04-03 04:50:01 +02:00 committed by Will
parent 466b2b82d0
commit 0f9501f93a

View File

@ -71,7 +71,7 @@ class Tunnel(metaclass=TunnelMeta):
self.last_interaction = datetime.utcnow() self.last_interaction = datetime.utcnow()
async def react_close(self, *, uid: int, message: str = ""): async def react_close(self, *, uid: int, message: str = ""):
send_to = self.origin if uid == self.sender.id else self.sender send_to = self.recipient if uid == self.sender.id else self.origin
closer = next(filter(lambda x: x.id == uid, (self.sender, self.recipient)), None) closer = next(filter(lambda x: x.id == uid, (self.sender, self.recipient)), None)
await send_to.send(filter_mass_mentions(message.format(closer=closer))) await send_to.send(filter_mass_mentions(message.format(closer=closer)))