def create_message(text, phone_number): if emojis_for_emoticons.get(text, None) or text_contains_emoji(text): return EmojiRequest(text, phone_number) if Secrets.get_secret(text): return SecretRequest(text, phone_number) return None
def create_reply(self): matched_secret = Secrets.get_secret(self.text) if not matched_secret: raise RuntimeError("Improperly identified message type") return create_response(matched_secret.text, matched_secret.media)