def extract_command(text):
 return (text.split()[0].split('@')[0][1:] if is_command(text) else None)

def extract_command ( text ) : return ( text . split ( ) [ 0 ] . split ( '@' ) [ 0 ] [ 1 : ] if is_command ( text ) else None )
extracts the command from text if text is a command .