<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_group(self):
 """True if the message was sent on a group or megagroup."""

        if self._broadcast is None and self.chat:
            self._broadcast = getattr(self.chat, 'broadcast', None)

        return (
            isinstance(self._chat_peer, (types.PeerChat, types.PeerChannel))
            and not self._broadcast
        )