async def HandleMessage(self, msg: Message): print(f'[{self.addr}] -> {msg}') # handle commands if msg.content.startswith(':'): await self.HandleCommand(msg) else: msg.content = f'[{self.username}] {msg.content}' await self.server.broadcast(msg, self)
async def ReplacePlaceholders(self, msg: Message) -> Message: msg.content = msg.content.format(username=self.username, time=datetime.now().strftime("%H:%M"), servername=self.server.getName()) return msg