def validate_dm(self, code):
        """Validates the code given for potential exploits."""

        for expr in self._safety_expressions:
            if expr.search(code):
                raise BotError("Disallowed/dangerous code found. Aborting.", "validate_dm")